When `addSheet` is used and `mStyleSetFilled` is true in
`Document::AddAdditionalStyleSheet`, then the stylesheets are appended
in the expected order.
When `mStyleSetFilled` is false, it is populated later via
`Document::FillStyleSet`, in `Document::FillStyleSetDocumentSheets`.
Before this patch (already since inception in bug 804120), the order was
reversed, which sometimes causes observably different results.
This patch fixes the issue by appending them in order.
Differential Revision: https://phabricator.services.mozilla.com/D248722
This change ensures that closedby=none blocks escape when the flag is
enabled. This was noted when enabling the feature flag in the entire
`the-dialog-element` wpt __dir__ meta file, and running the test suite -
spotting a failure in `popover-closedby-simple.html`. This failure
occurs because the current behaviour for pressing escape skips over
elements that are `closedby=none`. However `closedby=none` should not
_skip_ these elements, but should instead return early - effectively
blocking the Esc key.
With this change made, as well as keeping the change in __dir__, the
dialog-popover-closedby-simple case passes, but also the
dialog-popover-closedby-complex cases pass - so they've been
rebaselined.
Differential Revision: https://phabricator.services.mozilla.com/D248291
We do not need to iterate over all open dialogs, as the top-most dialog
must respond _somehow_ to the escape key press, it either closes, or it
blocks the escape key-press, disallowing outer dialogs to handle the
key-press.
Differential Revision: https://phabricator.services.mozilla.com/D248309
UpdateRemoteFrameEffects already deals with remote browsers in popups,
so we don't need to handle it sync from nsMenuPopupFrame and co.
But the handling is not particularly great. Right now that code is using
IntersectionObserver on the main window to determine whether it's
visible.
It's not the case currently, but there's no need for a popup to really
intersect the main window. So make the Document.cpp code deal with
popups a bit more conservatively while we're doing this.
Differential Revision: https://phabricator.services.mozilla.com/D247773
In D235504 this code was changed from using QueueCancelDialog to using
RequestClose, for consistency. However it seems some code _may_ depend
on the close being run after a tick, so to avoid regressions, this has
been changed to use QueueCancelDialog if the feature-flag is off,
restoring the old behaviour.
Differential Revision: https://phabricator.services.mozilla.com/D247886
This reverts commit 1faeaa00f5.
Revert "Bug 1959727 - Implement ShadowRoot.setHTML and share more code. r=emilio"
This reverts commit 3a84b03088.
Revert "Bug 1959727 - Add the sanitizer option to parseHTMLUnsafe. r=emilio" for causing wpt failures in Document-parseHTMLUnsafe.html
This reverts commit 17ced5ec89.
In order to do this and keep tests passing, we need to also recurse into
external resource docs during the refresh driver tick.
Otherwise, we fail dom/smil/test/test_smilExtDoc.xhtml. This used to
work because the SMIL controller registered with the refresh driver
directly, and resource docs share the refresh driver with the parent
doc. I think it makes sense to treat them more like subdocuments, and it
also matches svg-as-image better.
This fixes some known SMIL bugs, too, yay.
Differential Revision: https://phabricator.services.mozilla.com/D246588
In order to do this and keep tests passing, we need to also recurse into
external resource docs during the refresh driver tick.
Otherwise, we fail dom/smil/test/test_smilExtDoc.xhtml. This used to
work because the SMIL controller registered with the refresh driver
directly, and resource docs share the refresh driver with the parent
doc. I think it makes sense to treat them more like subdocuments, and it
also matches svg-as-image better.
This fixes some known SMIL bugs, too, yay.
Differential Revision: https://phabricator.services.mozilla.com/D246588
Otherwise we can end up with dirty frames at the end of a flush. This
doesn't fix bug 1958522 (I think we need either height: fit-content to
work, or IntersectionObserver.scrollMargin). But matches the HTML spec:
> The intent of this step is for the initial viewport proximity
> determination, which takes effect immediately, to be reflected in the
> style and layout calculation which is carried out in a previous step of
> this loop. Proximity determinations other than the initial one take
> effect at the next rendering opportunity.
Differential Revision: https://phabricator.services.mozilla.com/D245489
Run it in the right step of the rendering loop as per spec. Keep
the interruptible layout behavior by detecting whether we have any
frame with content-visibility: auto / ResizeObserver / etc around.
Also make the IntersectionObserver phase not unconditional, make it
conditional on needing layout or having scrolled.
I want to look a bit whether we can avoid flushing the whole browsing
context tree, but that is pre-existing so not touching it as part of
this work.
Differential Revision: https://phabricator.services.mozilla.com/D245214
Deal with events per-document like the spec. This also ensures that view
transition rendering suppressions and such work for this rendering
phase.
Differential Revision: https://phabricator.services.mozilla.com/D244670