Firefox does it right but Chrome doesn't?!?!?!?!?!?!?!?!?!?!
-
https://jsfiddle.net/1zpwh04w/
Click inside the first yellow box. Push Ctrl+A. In Firefox, it selects all. In Chrome, it moves the cursor to the end of the box and does not select anything.
Click inside the second yellow box. Push Ctrl+A. It works correctly in both browsers.
How do I make the first case (uneditable thing as the first thing in an editable thing) work on both browsers?
-
@ben_lubar said in Firefox does it right but Chrome doesn't?!?!?!?!?!?!?!?!?!?!:
uneditable thing
In FireFox, everything in your boxes, including "Bob said" is editable. But if you want it to be uneditable, add
contenteditable="false"
to theheader
.
-
Interesting... it seems there absolutely must be a piece of editable content?
I think that's a glitch.
-
@Adynathos said in Firefox does it right but Chrome doesn't?!?!?!?!?!?!?!?!?!?!:
@ben_lubar said in Firefox does it right but Chrome doesn't?!?!?!?!?!?!?!?!?!?!:
uneditable thing
In FireFox, everything in your boxes, including "Bob said" is editable. But if you want it to be uneditable, add
contenteditable="false"
to theheader
.That's really weird, because Firefox defines that CSS property on contenteditable="true" and contenteditable="false", and their own documentation says it's a thing since Firefox 1.0: https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-user-modify
-
@ben_lubar
-moz-user-modify
does not seem to do anything.My test http://liskr.net/test/ of
contenteditable
- it seemscontenteditable="false"
parts incontenteditable=true
are treated as monolithic blocks - can't be edited but can be removed.
-
@Adynathos said in Firefox does it right but Chrome doesn't?!?!?!?!?!?!?!?!?!?!:
@ben_lubar
-moz-user-modify
does not seem to do anything.My test http://liskr.net/test/ of
contenteditable
- it seemscontenteditable="false"
parts incontenteditable=true
are treated as monolithic blocks - can't be edited but can be removed.The thing I'm confused about is why Firefox is defining that CSS property if it doesn't use it.
-
Welcome to web development.
-
@ben_lubar Have you shown user CSS? It shows what you are overriding in each browser.
It always a "oh fuck I didn't check this" moment.
Each browser has it own default styles.
-
@ben_lubar said in Firefox does it right but Chrome doesn't?!?!?!?!?!?!?!?!?!?!:
How do I make the first case (uneditable thing as the first thing in an editable thing) work on both browsers?
if(browser.chrome) { $("#secondbox *").remove(); $("#secondbox").append("<a href='https://ftp.mozilla.org/pub/firefox/releases/22.0/win32/en-US/Firefox%20Setup%2022.0.exe'>Get a real browser you fucktard</a>"); }
-
https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-user-modify:
- write-only
The user is able to edit the content, but not to read it.
- write-only
-
@Lorne-Kates You should cache you selectors for speed.
-
@lucas1 said in Firefox does it right but Chrome doesn't?!?!?!?!?!?!?!?!?!?!:
@Lorne-Kates You should cache you selectors for speed.
Meh, find-by-ID is O(1) anyways.
-
@Lorne-Kates but you didn't do that you did, ID > All. Which is slow.
-
@lucas1 said in Firefox does it right but Chrome doesn't?!?!?!?!?!?!?!?!?!?!:
@Lorne-Kates but you didn't do that you did, ID > All. Which is slow.
Well, he could have done
$("#secondbox").html("<a href='https://ftp.mozilla.org/pub/firefox/releases/22.0/win32/en-US/Firefox%20Setup%2022.0.exe'>Get a real browser you fucktard</a>")
Huh, guess there was an image in my clipboard. Oh.
-
@lucas1 said in Firefox does it right but Chrome doesn't?!?!?!?!?!?!?!?!?!?!:
@Lorne-Kates but you didn't do that you did, ID > All. Which is slow.
And I only used it once, so there's no need to cache it.
-
@lucas1 said in Firefox does it right but Chrome doesn't?!?!?!?!?!?!?!?!?!?!:
@Lorne-Kates You should cache you selectors for speed.
function getWidgetSelector() { if (!selectorCache["widgetSelector"]) { selectorCache["widgetSelector"] = "#widgets *"; } return selectorCache["widgetSelector"]; }
-
@ben_lubar said in Firefox does it right but Chrome doesn't?!?!?!?!?!?!?!?!?!?!:
@Adynathos said in Firefox does it right but Chrome doesn't?!?!?!?!?!?!?!?!?!?!:
@ben_lubar said in Firefox does it right but Chrome doesn't?!?!?!?!?!?!?!?!?!?!:
uneditable thing
In FireFox, everything in your boxes, including "Bob said" is editable. But if you want it to be uneditable, add
contenteditable="false"
to theheader
.That's really weird, because Firefox defines that CSS property on contenteditable="true" and contenteditable="false", and their own documentation says it's a thing since Firefox 1.0: https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-user-modify
It's supported by all modern browsers but even the W3C editing taskforce themselves admits all browser supporting this disagree on how it should work and acts differently.
Better avoid it if you can.