Open Bug 1586628 Opened 5 years ago Updated 2 years ago

Re-evaluate when we set eSetValue_ForXUL

Categories

(Core :: DOM: Editor, task, P3)

task

Tracking

()

People

(Reporter: ntim, Unassigned)

References

Details

We’re currently setting this when the parent of the input is a XUL element, which targets very well XUL <textbox> since the input is guaranteed to be a child of a XUL moz-input-box. However, with the recent conversions from <textbox> to HTML inputs, the parent element of the input can pretty much be anything, meaning the check is not as solid.

Here’s where the flag is set: https://searchfox.org/mozilla-central/rev/b6f088f2f68d2a8ae0b49d6c8fbd7cbd3a65fa5b/dom/html/HTMLInputElement.cpp#2620

I think it would probably make sense here to either:

  • instead check that the root element is XUL
  • decide that we don’t want any special behavior for XUL documents and remove the related code

For reference, here’s where the special behavior is implemented: https://searchfox.org/mozilla-central/rev/b6f088f2f68d2a8ae0b49d6c8fbd7cbd3a65fa5b/dom/html/nsTextEditorState.cpp#2330

Masayuki, Brian, what do you think ?

Flags: needinfo?(masayuki)
Flags: needinfo?(bgrinstead)

If the latter does not break any existing feature, I like it better, however, we were not sure about that. Therefore, we decided to make it stay there when we are disabling undo history at setting value in HTML document for compatibility with the other browsers and for the performance. So, if you remove the feature, even in XUL document, users won't be able to do "undo" after chrome script setting its value. So, be careful if you do that.

Otherwise, the former sounds reasonable to me (or checking whether chrome document or not provides consistent behavior in our UI?).

Flags: needinfo?(masayuki)

instead check that the root element is XUL
decide that we don’t want any special behavior for XUL documents and remove the related code

We are working on converting the root element in browser.xhtml to <html> in Bug 1492582, so I'd strongly prefer the latter if it's possible. If we need to keep it, we could instead put a new attribute on the root node (or the parent of the <input>).

Flags: needinfo?(bgrinstead)
Priority: -- → P3
See Also: → 1676785
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.