The old setup unset the HasDirAuto flag when changing the "dir" attr away from
the value "auto", and reset it when setting it to "auto", before calling
SetDirectionalityFromValue. But SetDirectionalityFromValue doesn't depend on
the HasDirAuto flag, and that flag is set correctly for us by nsGenericElement,
so we don't have to manage it ourselves at all.
The callers outside BeforeSetAttr/AfterSetAttr just preserved the flag value, so
there's no behavior change at all for them.
MozReview-Commit-ID: AC8uV3cOtH2
If all fields in date/time input box are available but the input element's
value is empty, implies that it has been sanitized. In this case, we'll set the
'bad input' validity state. If any of the fields is cleared, we'll remove the
'bad input' validity state, as incomplete field does not imply 'bad input'.
MozReview-Commit-ID: 4EBpH5CWqXM
In this patch, we change it so that we always set the input element's value
once all fields are available and let DOM HTMLInputElement sanitize it. The
value after sanitization is not updated in the displayed input box, but may
display an error message (this will be done in Part 2) if needed.
Also, when any of the field's value is deleted, we will set input element's
value back to the empty string, so that a value is not accidentally submitted.
MozReview-Commit-ID: 9NAL8UlkoBK
Annoyingly, setting the pref doesn't magically make the function appear on the
current window, so we create an iframe and retrieve it from there.
MozReview-Commit-ID: 9fOr4YJOzXh
--HG--
extra : rebase_source : d23643b388538955cc831a3b6e1473232ab5498a
The old setup unset the HasDirAuto flag when changing the "dir" attr away from
the value "auto", and reset it when setting it to "auto", before calling
SetDirectionalityFromValue. But SetDirectionalityFromValue doesn't depend on
the HasDirAuto flag, and that flag is set correctly for us by nsGenericElement,
so we don't have to manage it ourselves at all.
The callers outside BeforeSetAttr/AfterSetAttr just preserved the flag value, so
there's no behavior change at all for them.
MozReview-Commit-ID: AC8uV3cOtH2
--HG--
extra : rebase_source : c71739095e4b65e7db10f6174a875891f97738d6
Currently, nsGenericHTMLElement::CopyInnerTo uses SetInlineStyleDeclaration to clone CSS attributes. However, if we used SetParsedAttr instead, the declaration block would be addref'ed instead of being cloned.
We need to mark the declaration block as immutable in that situation so that the attribute is copied on write.
MozReview-Commit-ID: QMm23bfwqD
--HG--
extra : rebase_source : a7d8596e2f52bef21e56b9a979638c970be4c603
We get previous input.value twice in HTMLInputElement::SetValue and nsTextEditorState::SetValue when setting input.value. Since nsTextEditorState::GetValue uses DocumentEncoder, it is expensive. So we should use old value as parameter of nsTextEditorState::SetValue if possible.
MozReview-Commit-ID: A1UPfETTVCn
--HG--
extra : rebase_source : f751289b42b4d9d5c389042f688c53bde47d1620
Now that the side effects of parsing have been relocated to BeforeSetAttr and AfterSetAttr (Bug 1365092), we can easily switch nsGenericHTMLElement::CopyInnerTo from reparsing attributes to cloning them. They are still reparsed, however, in the case where the owning document is changing since Base URIs may have changed.
MozReview-Commit-ID: 2TlUUyBx6bL
--HG--
extra : rebase_source : b581e797a24230d012cf79c1fc567c05d9acc746
Move the data URI in 'if_no_scripts' and 'if_scripts' to seperate files.
Also remove the test 'if_19', as it seems redundant, it tests the same
thing with the iframe 'if_scripts', and it also lacks of 'allow-scripts'
in its sandbox flag.
Per spec [1], date/time inputs fall into this category:
"For input elements without a defined input activation behavior, but to which
these events apply, and for which the user interface involves an explicit
commit action but no intermediate manipulation, then any time the user commits
a change to the element's value, the user agent must queue a task to first fire
an event named input at the input element, with the bubbles attribute
initialized to true, and then fire an event named change at the input element,
with the bubbles attribute initialized to true."
So, we fire input/change events when:
- User selects a date/time from the picker
- User changes the value using up/down keys in a already complete date/time
value
- User changes the value using the number keyboard in a already complete
date/time value
- User clears the value (using reset button or using backspace)
MozReview-Commit-ID: E7Jc5qMKZj4
--HG--
extra : rebase_source : 01d4ddbf97d7cef626491946e008a88db4641258
1. Sort by TextTrack. 2. Sort by time. 3. Sort by the order of added to TextTrack.
MozReview-Commit-ID: 4nwx6U5dMpy
--HG--
extra : rebase_source : 2998c48982e40604b068ffca525691c5b69ae2cf
For the Quatum DOM project, it's better to work in terms of event targets than
threads. This patch converts DOM code to operate on event targets rather than
threads, when possible.
MozReview-Commit-ID: 5FgvpKadUA2
It logically makes more sense for these effects to happen after the attribute has actually been changed and moving them allows us to get rid of the member variable HTMLImageElement::mForceReload.
MozReview-Commit-ID: IJBF3AHVb0U
--HG--
extra : rebase_source : fe3ae2a0cc55ded9702fb7654261ffee83a52057
Now we can init some members in the constructor and remove the setters
that are called only once.
MozReview-Commit-ID: 2hkrIA6pFlh
--HG--
extra : rebase_source : 33c008ef1508597e64ef7f92b028867dbd4ffba6
extra : source : fa213ee733ea881f4f76dac06c9b4709aeba4b91
We will add more fields to MediaDecoderInit and be able to remove some setters.
MozReview-Commit-ID: BVx935IHQHf
--HG--
extra : rebase_source : 6d167265e478ce39881ceada1303e9ca18189bbf
extra : source : 0c26f909568f673591ad6720458dfc912c01daad
nsIPlaintestEditor.setText still use BeginPlaceHolderTransaction and EndPlaceHolderTransaction. But since input.value setter doesn't create undo transaction, it is unnecessary to save/restore selection via AutoPlaceHolderBatch. So before calling setText, we should reset selection to reduce saving and restoring selection.
Save/Restore selection is ~7% of input.value setter.
MozReview-Commit-ID: 6yBKCtRmkQt
--HG--
extra : rebase_source : 4df5d0629f083b75615b96b17bc108613fe80c24
Although we use StartBatchChanges and EndBatchChanges in nsTextEditorState::SetValue, we have a path that EndBatchChanges isn't called. So we should use RAII class to call EndBatchChanges correctly.
MozReview-Commit-ID: 6bjtTT9wItA
--HG--
extra : rebase_source : dc9bdcb1a5ac4bca026e378c79355041d7f2384a
This is necessary to facilitate the transition to cloning attributes instead of reparsing them.
MozReview-Commit-ID: Gyd1tD6ldly
--HG--
extra : rebase_source : 777cfed750c95c448f953a6ec98026481997e227
This is necessary to facilitate the transition to cloning attributes instead of reparsing them.
HTMLImageElement's side effects proved to be a bit trickier than those of many other classes because HTMLImageElement::SetAttr intentionally forces an image reload, even if the attribute value has not been changed. Element::SetAttr, on the other hand, usually ignores attribute changes that do not change the attribute value, exiting before BeforeSetAttr is even called. In order to preserve this behavior, another virtual function |OnAttrSetButNotChanged| was added to the Element class. This function will be called in the case that Element::SetAttr exits early, allowing a forced reload to take place at that time.
MozReview-Commit-ID: 4CrH30bo5GT
--HG--
extra : rebase_source : 94245dde2710abd439671d05e99f145caca3e189