Commit Graph

16116 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
99ed9d65e3 Bug 1640843 - Finer grained invalidation for attribute changes. r=heycam
This should help out quite a bit with uBO, which has lots of very
general attribute selectors. We invalidate per attribute name rather
than using a SelectorMap, which prevents matching for attribute
selectors that can't have changed.

The idea is that this should be generally cheaper, though there are
cases where this would be a slight pesimization. For example, if there's
an attribute selector like:

  my-specific-element[my-attribute] { /* ... */ }

And you change `my-attribute` in an element that isn't a
`my-specific-element`, before that the SelectorMap would've prevented us
from selector-matching completely. Now we'd still run selector-matching
for that (though the matching would be pretty cheap).

However I think this should speed up things generally, let's see what
the perf tests think before landing this though.

Differential Revision: https://phabricator.services.mozilla.com/D76825
2020-05-27 09:17:47 +00:00
Cameron McCormack
1e8189c0f1 Bug 1640537 - Improve style sheet dumping in the layout debugger. r=TYLin
Make it show the contents of style sheets (as it used to before Stylo)
and make it work in --disable-debug --enable-layout-debugger builds.

Differential Revision: https://phabricator.services.mozilla.com/D76640
2020-05-26 23:07:36 +00:00
Emilio Cobos Álvarez
835dce9943 Bug 1640861 - Remove unused ServoElementSnapshot::mIsHTMLElementInHTMLDocument. r=xidorn
Differential Revision: https://phabricator.services.mozilla.com/D76820
2020-05-26 11:25:12 +00:00
Emilio Cobos Álvarez
b68f73c01a Bug 1635675 - Implement the ::file-chooser-button pseudo-element. r=jwatt
As per https://github.com/w3c/csswg-drafts/issues/5049.

Don't enable it unconditionally just yet, as the name may change.

I had to move some rules in forms.css because otherwise you get
specificity conflicts.

Differential Revision: https://phabricator.services.mozilla.com/D76214
2020-05-25 23:54:10 +00:00
Cameron McCormack
253234aaa1 Bug 1640545 - Make attribute substring selectors a little faster. r=emilio
In the common case of using case sensitive matching, improvements come from:

* for attributes backed by nsStringBuffers, not needing to AddRef/Release the
  string buffer
* for attributes backed by atoms, not needing to run the destructor of an
  nsDependentAtomString
* for prefix and suffix attribute selectors, using memcmp instead of the
  slower StringBeginsWith/StringEndsWith (which read a character at a
  time and call a virtual function on the comparator object)
* for the substring attribute selector, using std::search(), which also
  avoids virtual function calls on a comparator object

Attribute selector performance is important on pages with many links
with ad blocker extensions that use such selectors installed.

On my machine, this drops total time spent loading the single page HTML
spec

* under Gecko_AttrHasPrefix from 2.69 s to 1.25 s
* under Gecko_AttrHasSubstring from 1.06 s to 0.30 s

Differential Revision: https://phabricator.services.mozilla.com/D76643
2020-05-25 22:26:09 +00:00
Honza Bambas
deeb00bdf9 Bug 1637039 - Use RemoveSelf when removing preload for a font on its use (cosmetic, no functional change), r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D76366
2020-05-25 18:39:51 +00:00
Honza Bambas
6b93122fab Bug 1637039 - Notify style preload when the loading channel synchronously fails to open, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D76365
2020-05-25 18:39:34 +00:00
Jan
8066a467c7 Bug 1633192 - Added 'scroll-margin: inherit;' to ua.css to make scroll-margin work on elements with 'display: table'. r=emilio
Forgot to add test to the first commit.

Moved bug reference link to seperate link tag in scroll-target-margin-004.html and changed comment on modified css line.

Differential Revision: https://phabricator.services.mozilla.com/D76685
2020-05-25 11:55:56 +00:00
Emilio Cobos Álvarez
19132e6d57 Bug 1639756 - Address some nits that I missed.
Differential Revision: https://phabricator.services.mozilla.com/D76678
2020-05-25 10:32:48 +00:00
Narcis Beleuzu
973d9eb6a0 Backed out changeset 82df6f70ec60 (bug 1635675) for lint failure on file-chooser-button-001.tentative.html . CLOSED TREE 2020-05-25 13:49:39 +03:00
Emilio Cobos Álvarez
a39a3a3807 Bug 1635675 - Implement the ::file-chooser-button pseudo-element. r=jwatt
As per https://github.com/w3c/csswg-drafts/issues/5049.

Don't enable it unconditionally just yet, as the name may change.

I had to move some rules in forms.css because otherwise you get
specificity conflicts.

Differential Revision: https://phabricator.services.mozilla.com/D76214
2020-05-21 12:27:54 +00:00
Emilio Cobos Álvarez
8017e73680 Bug 1639756 - Clean up quirks.css using :is(). r=jwatt
This one I went all-in with :is(). Because even if we have to do some more
selector-matching for each element, we need to check the more expensive
selectors and the combinators less often, so I don't think we end up worse than
before, and the difference is massive.

Differential Revision: https://phabricator.services.mozilla.com/D76266
2020-05-21 13:28:53 +00:00
Emilio Cobos Álvarez
26884c5b8d Bug 1639756 - Cleanup html.css using :is(). r=jwatt
There's some lists code that I could technically clean up a bit more, but I
erred in the side of making the selectors as fast as possible with our current
infrastructure.

For example, this selector list:

    :is(ul, ol, dir, menu, dl) ul,
    :is(ul, ol, dir, menu, dl) ol,
    :is(ul, ol, dir, menu, dl) dir,
    :is(ul, ol, dir, menu, dl) menu,
    :is(ul, ol, dir, menu, dl) dl

Could be reduced to:

    :is(ul, ol, dir, menu, dl) :is(ul, ol, dir, menu, dl)

But that means that for `dl` elements we'll selector-match all the selectors
inside the :is() instead of just `dl`. Maybe it doesn't matter compared with
the work of going up all the parent chain, but I erred in the side of caution
for most of these.

Differential Revision: https://phabricator.services.mozilla.com/D76265
2020-05-21 13:24:40 +00:00
Emilio Cobos Álvarez
5dd7d4f58a Bug 1639756 - Cleanup ua.css by using :is(). r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D76264
2020-05-21 12:27:31 +00:00
Emilio Cobos Álvarez
5c2f9bc52c Bug 1639756 - Clean-up forms.css by using :is(). r=jwatt
I also removed some unneeded specific selectors for ::placeholder /
::-moz-text-control-editing-root / etc. We only query them for textarea
/ input elements, so it is more of a pesimization than an optimization.

Differential Revision: https://phabricator.services.mozilla.com/D76263
2020-05-21 12:27:24 +00:00
Emilio Cobos Álvarez
1ed9a59aaf Bug 1640158 - Remove useless principal-passing in the CSS loader. r=ckerschb
The only caller that passes that principal is the only caller that calls
into LoadSheet with a loader that has a document anyway.

And the principal we're passing is Document::NodePrincipal(), which is
what we'd end up using anyway, so the new code is exactly equivalent, as
far as I can tell.

Differential Revision: https://phabricator.services.mozilla.com/D76469
2020-05-25 09:42:01 +00:00
Sylvestre Ledru
615c83d723 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D76451
2020-05-25 07:42:38 +00:00
Cameron McCormack
bc1ac01d88 Bug 1640540 - Part 2: Use ASCII case insensitive comparisons for all attribute selectors. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D76642
2020-05-25 00:46:03 +00:00
sefeng
67c1284c8c Bug 1637307 - Push/Pop dialog to top layer when needed r=smaug,emilio
This patch completes the top layer requirement for showModal()
Spec: https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-showmodal

Differential Revision: https://phabricator.services.mozilla.com/D74922
2020-05-23 01:45:33 +00:00
Mihai Alexandru Michis
37ef8a125d Backed out changeset a845717e4d10 (bug 1482279) for causing multiple failures.
CLOSED TREE
2020-05-23 02:22:20 +03:00
Masatoshi Kimura
0701e89b7e Bug 1482279 - Stop using Cu.forcePermissiveCOWs() in SpecialPowers. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D74641
2020-05-22 21:46:25 +00:00
Mats Palmgren
7d8f8a5007 Bug 1639664 - Allow 'opacity' on ::first-letter/::first-line pseudos. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D76387
2020-05-21 21:13:10 +00:00
Emilio Cobos Álvarez
7b19f0d6d4 Bug 1609024 - Remove cache mechanism which is not very useful. r=hiro,snorp,mccr8
I don't think all this complexity is worth it for having a
marginally-more-realistic testing story. Using the pref just works and we should
do that, I think.

Differential Revision: https://phabricator.services.mozilla.com/D59980
2020-05-21 17:02:06 +00:00
Boris Chiou
6b78a43a20 Bug 1635939 - Replace AspectRatio with computed::position::Ratio in media-queries. r=emilio
Also, we drop the pref, layout.css.aspect-ratio-number.enabled, becacuse
the spec of css-sizing-4 uses Number now.

Differential Revision: https://phabricator.services.mozilla.com/D75233
2020-05-20 21:13:35 +00:00
Boris Chiou
599c6939d9 Bug 1635939 - Let aspect-ratio (css-sizing-4) support 'auto | <ratio>'. r=emilio
In order to test its parsing and serialization, we expose it but protect
it behind a pref.

Besides, I would like to drop layout.css.aspect-ratio-number.enabled in
the next patch because the spec has been updated. It seems we don't have
to keep this pref and we should always use Number.

Differential Revision: https://phabricator.services.mozilla.com/D74955
2020-05-21 06:45:10 +00:00
Emilio Cobos Álvarez
c3b7227771 Bug 1639392 - Merge nsIStyleSheetLinkingElement and nsStyleLinkElement, and call it LinkStyle. r=jwatt
Which is the spec term. nsIStyleSheetLinkingElement is even more
confusing since it may not be an element at all (see: processing
instructions).

Differential Revision: https://phabricator.services.mozilla.com/D76071
2020-05-21 03:07:16 +00:00
Csoregi Natalia
40b453bd7c Backed out 7 changesets (bug 1602757, bug 1612063) for browser-chrome failures on browser_resource_uri.js. CLOSED TREE
Backed out changeset 2556e3876602 (bug 1602757)
Backed out changeset 1c98ac1c4283 (bug 1602757)
Backed out changeset 2c7bf6206bb4 (bug 1602757)
Backed out changeset a0142f6bb65f (bug 1602757)
Backed out changeset 7f114ce6b98d (bug 1612063)
Backed out changeset d9b4b2cffaa5 (bug 1602757)
Backed out changeset 33515632a7db (bug 1602757)
2020-05-21 04:09:56 +03:00
Emilio Cobos Álvarez
e41d05d0ca Bug 1639262 - Get the right "is preload" value to CreateSheet. r=nordzilla
This could also cause mismatches in the cache for no good reason.

Differential Revision: https://phabricator.services.mozilla.com/D76003
2020-05-21 00:06:25 +00:00
Emilio Cobos Álvarez
a147afc07d Bug 1639262 - Avoid duplicate entries in the stylesheet cache. r=nordzilla,firefox-style-system-reviewers
When the loader finds an already-complete stylesheet, it will call
PostLoadEvent to fire the load event of the relevant <link> element,
etc.

For that, it'll mint a SheetLoadData, with various fields hard-coded.
That causes us to eventually insert the sheet in mCompleteSheets, but
with a different key, which means we'll end up with two copies of the
same stylesheet in the cache, than when reporting memory we'll report
twice.

Fix it by constructing the right load data a bit sooner, and add an
assertion to ensure this doesn't happen anymore.

Differential Revision: https://phabricator.services.mozilla.com/D76000
2020-05-20 21:16:04 +00:00
Emilio Cobos Álvarez
b50a39c2d3 Bug 1639533 - Fix a no-longer valid assumption in pseudo-element matching / invalidation code. r=heycam
After bug 1632647, we can have pseudo-classes inside :not / :is /
:where, which the invalidation and matching code weren't handling.

Add a few tests for this stuff working as expected.

Differential Revision: https://phabricator.services.mozilla.com/D76160
2020-05-20 23:53:34 +00:00
Emilio Cobos Álvarez
a594bf82aa Bug 1639533 - Fix a case where we'd allow parsing functional :host incorrectly. r=heycam
This is a missing check I should've introduced in bug 1632647.

Differential Revision: https://phabricator.services.mozilla.com/D76161
2020-05-20 23:54:16 +00:00
Randell Jesup
6e41b86812 Bug 1602757: Work around LookAndFeel not propagating to processes without tabs r=emilio
This is a workaround for bug 1638618

Differential Revision: https://phabricator.services.mozilla.com/D76187
2020-05-20 22:37:15 +00:00
Ting-Yu Lin
162c8d3a67 Bug 1638928 Part 2 - Rename nsIFrame's GetChildLists() to ChildLists(). r=mats
This patch is generated by using my editor's rename functionality.

In the next patch, `nsIFrame::` prefix is going to be removed manually
from all the ChildLists() calls.

Differential Revision: https://phabricator.services.mozilla.com/D75893
2020-05-19 12:37:37 +00:00
Ting-Yu Lin
0865183345 Bug 1638917 - Replace mozilla::Tuple with std::tuple in layout. r=emilio
Also, replace mozilla::Tie with std::tie, and use C++17 structured
binding at some places where they make sense.

Differential Revision: https://phabricator.services.mozilla.com/D75821
2020-05-19 03:59:23 +00:00
Emilio Cobos Álvarez
f0953195ce Bug 1636998 - Make ::-moz-focus-outer a no-op, and remove it on Nightly. r=jwatt
See https://bugzilla.mozilla.org/show_bug.cgi?id=932410#c2 for the
context for which this pseudo-element was added.

In the previous patch, I had to special-case range appearance because of
this pseudo-class, but that patch makes this pseudo-class completely
redundant, as now all form controls, themed and unthemed, display
outlines, unless the native theme displays a focus indicator on its own.

Remove the special case, and make ranges use outlines like everything
else rather than this bespoke pseudo-element.

Differential Revision: https://phabricator.services.mozilla.com/D74734
2020-05-18 10:54:16 +00:00
Csoregi Natalia
f6ee95862e Backed out changeset 62ad26fbfaf8 (bug 1636998) for reftest failures on 1174332-1.html. CLOSED TREE 2020-05-18 13:31:56 +03:00
Emilio Cobos Álvarez
36b46408b8 Bug 1636998 - Make ::-moz-focus-outer a no-op, and remove it on Nightly. r=jwatt
See https://bugzilla.mozilla.org/show_bug.cgi?id=932410#c2 for the
context for which this pseudo-element was added.

In the previous patch, I had to special-case range appearance because of
this pseudo-class, but that patch makes this pseudo-class completely
redundant, as now all form controls, themed and unthemed, display
outlines, unless the native theme displays a focus indicator on its own.

Remove the special case, and make ranges use outlines like everything
else rather than this bespoke pseudo-element.

Differential Revision: https://phabricator.services.mozilla.com/D74734
2020-05-18 07:59:32 +00:00
Ting-Yu Lin
b98820d020 Bug 1635319 Part 3 - Use range-based for loops instead of ChildListIterator in other layout directories. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D75654
2020-05-18 01:12:26 +00:00
Nicklas Boman
4f2fa0cfa7 Bug 1515419 - fixing ToNewCString (and ToNewUnicode as well) xpcom/string/nsReadableUtils.cpp r=froydnj,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D17411
2020-05-17 06:58:48 +00:00
Xidorn Quan
58b03accf4 Bug 1276537 part 1 - Make resizable window on macOS always show full screen button. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D74833
2020-05-15 06:19:14 +00:00
Emily McDonough
c161bb67d3 Bug 1564128 part 2 - Copy animations to static document clones r=emilio,hiro
This also requires changing the EffectCompositor to allow animations in print
and print preview, and setting up a document timeline for the cloned document

Differential Revision: https://phabricator.services.mozilla.com/D69069
2020-05-14 19:41:03 +00:00
Emilio Cobos Álvarez
b9c1bf761c Bug 312971 - Unprefix -moz-read-write / -moz-read-only. r=edgar
And remove some duplicated tests from WPT.

Differential Revision: https://phabricator.services.mozilla.com/D75231
2020-05-14 16:46:08 +00:00
Emilio Cobos Álvarez
7a14870e23 Bug 1636998 - Only suppress auto-style outlines for widgets that paint their own focus indicator. r=jfkthame
Turns out we did have a hook for this already! But it is used to draw or
not inner button styles, so not quite equivalent.

I had to expand the amount of things it applies to because buttons and
such do paint focus indicators in all widgets. This patch could cause
some undesired outlines in some widgets. I hope not (I tried to audit to
the best of my knowledge), but in that case they'd be just more values
to add to the list.

Differential Revision: https://phabricator.services.mozilla.com/D74733
2020-05-13 20:38:26 +00:00
Narcis Beleuzu
23b4220599 Backed out changeset f5546bfc9604 (bug 1636998) for reftest failures on 1174332-1.html . CLOSED TREE 2020-05-13 23:22:56 +03:00
Emilio Cobos Álvarez
dbbe7901c1 Bug 1636998 - Only suppress auto-style outlines for widgets that paint their own focus indicator. r=jfkthame
Turns out we did have a hook for this already! But it is used to draw or
not inner button styles, so not quite equivalent.

I had to expand the amount of things it applies to because buttons and
such do paint focus indicators in all widgets. This patch could cause
some undesired outlines in some widgets. I hope not (I tried to audit to
the best of my knowledge), but in that case they'd be just more values
to add to the list.

Differential Revision: https://phabricator.services.mozilla.com/D74733
2020-05-13 14:47:07 +00:00
longsonr
5fa0ddbf8f Bug 935056 - Don't apply minimum font sizes to SVG text. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D74581
2020-05-13 09:10:54 +00:00
Noemi Erli
2f8e464584 Backed out changeset afdf4d60166d (bug 935056) for causing Android reftest failures CLOSED TREE 2020-05-13 11:33:57 +03:00
longsonr
8e8e982151 Bug 935056 - Don't apply minimum font sizes to SVG text. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D74581
2020-05-13 02:13:03 +00:00
Emilio Cobos Álvarez
52792dc151 Bug 1636974 - Unbust base toolchain builds by working around a GCC bug. CLOSED TREE
MANUAL PUSH: Unbust base toolchain builds, CLOSED TREE
2020-05-12 20:47:25 +02:00
Emilio Cobos Álvarez
ed46f1f078 Bug 1636974 - Make SheetLoadData know whether it's a preload on construction. r=mayhemer
And make a bunch of other stuff const while at it.

Differential Revision: https://phabricator.services.mozilla.com/D74860
2020-05-12 16:36:11 +00:00