Bug 1850293 - Make editable states not intrinsic. r=smaug,masayuki
This one is tricky because form controls, though I think I got it right... This fixes a pre-existing bug where we're not following the spec for readonly inside content-editable. I filed this as bug 1850390 but other browsers match the spec so add a test and fix it while at it. This allows cheaper checks for readonlyness in a couple places. Differential Revision: https://phabricator.services.mozilla.com/D186896
This commit is contained in:
@@ -1883,11 +1883,8 @@ nsresult TextControlState::PrepareEditor(const nsAString* aValue) {
|
||||
|
||||
editorFlags = newTextEditor->Flags();
|
||||
|
||||
// Check if the readonly attribute is set.
|
||||
//
|
||||
// TODO: Should probably call IsDisabled(), as it is cheaper.
|
||||
if (mTextCtrlElement->HasAttr(nsGkAtoms::readonly) ||
|
||||
mTextCtrlElement->HasAttr(nsGkAtoms::disabled)) {
|
||||
// Check if the readonly/disabled attributes are set.
|
||||
if (mTextCtrlElement->IsDisabledOrReadOnly()) {
|
||||
editorFlags |= nsIEditor::eEditorReadonlyMask;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user