Граф коммитов

69962 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez ac2f80304e Bug 1568536 - Don't propagate viewport styles from display: none or display: contents elements. r=dholbert
Resolution is at:

 * https://github.com/w3c/csswg-drafts/issues/3779#issuecomment-481762912

Tests are at https://chromium-review.googlesource.com/c/chromium/src/+/1547974,
I'll make sure to wait until they're in the tree and ensure they're passing.

Note that we need to ensure in the frame constructor that the document element
is styled _before_ calling UpdateViewportScrollStylesOverride(). This saves
duplicated work (since ResolveStyleLazily throws away the style).

ResolveStyleLazily already returns out of date styles, unless the element is not
styled yet, or is in a `display: none` subtree, in which case it computes and
returns a new (up-to-date) style.

So the switch to the FFI call only should change behavior for the display: none
subtree case (since we ensure the unstyled case isn't hit by styling the
document earlier). But that case is one of the cases we're interested in
changing, conveniently.

Depends on D40080

Differential Revision: https://phabricator.services.mozilla.com/D39204

--HG--
extra : moz-landing-system : lando
2019-08-16 11:43:36 +00:00
Emilio Cobos Álvarez a03875ef63 Bug 1568536 - Simplify some style system APIs. r=heycam
Return a raw pointer instead of a strong reference to a ComputedStyle, and
handle the case of the style not being present by returning null rather than
requiring an extra function to check it and crashing if the precondition is not
met.

Also, name them so that it's clear they just return outdated styles and don't
make any extra effort.

This is just cleanup that makes the next patch easier / more obvious.

Differential Revision: https://phabricator.services.mozilla.com/D40080

--HG--
extra : moz-landing-system : lando
2019-08-16 05:59:03 +00:00
Emilio Cobos Álvarez 479f277399 Bug 1480146 - Add memory reporting for the inline style cache. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D41731

--HG--
extra : moz-landing-system : lando
2019-08-16 10:56:25 +00:00
Emilio Cobos Álvarez c24f17aee9 Bug 1480146 - Add a cache for inline stylesheets without @import rules. r=heycam
Supporting @import was much more annoying (I had a patch but it became much more
complex than this), and seems other browsers don't do it either:

  https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/css/style_sheet_contents.cc?l=149&rcl=1999822baf4dc673088e65997fa07ad158f2e166
  https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/css/StyleSheetContents.cpp?rev=246490#L111

Also added a singleton perf test for <link> caching.

Maybe we should add some cache eviction here, but I'm not sure what'd be the
best policy here.

Differential Revision: https://phabricator.services.mozilla.com/D41564

--HG--
extra : moz-landing-system : lando
2019-08-16 10:56:23 +00:00
Emilio Cobos Álvarez a61410f8ae Bug 1571530 - Remove sheets from the <link> cache when they have been touched by CSS OM. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D41563

--HG--
extra : moz-landing-system : lando
2019-08-16 10:56:22 +00:00
Emilio Cobos Álvarez b9e6e577b3 Bug 1571530 - Move a bit of code around in Loader::LoadInlineSheet. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D41562

--HG--
extra : moz-landing-system : lando
2019-08-16 10:56:20 +00:00
Emilio Cobos Álvarez 86651be7e1 Bug 1571530 - Make PrepareSheet take a reference. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D41561

--HG--
extra : moz-landing-system : lando
2019-08-16 10:56:18 +00:00
Emilio Cobos Álvarez 919bb7ded3 Bug 1571530 - Cleanup slightly SheetComplete, and use the right boolean to notify. r=heycam
This is mostly straight-forward cleanup, but there's a behavior change which
was an oversight from bug 1386840, the regular mObservers stuff didn't pass the
right thing (was passing only mWasAlternate rather than whether it was
deferred).

I think that as a result, only in XML documents (since nsXMLContentSink is the
only thing that adds itself as a global CSS loader observer that ever looks at
this boolean), we may end up breaking this assert:

https://searchfox.org/mozilla-central/rev/9ae20497229225cb3fa729a787791f424ff8087b/dom/base/nsContentSink.cpp#183

(If there are any sheets with non-matching media queries and such).

But I couldn't find a test-case that broke it (tried SVG / XHTML), and in other
documents like pure XML you cannot specify a media query...

Differential Revision: https://phabricator.services.mozilla.com/D41091

--HG--
extra : moz-landing-system : lando
2019-08-16 10:56:16 +00:00
Emilio Cobos Álvarez 36d3f1e1b9 Bug 1571530 - Cleanup confusing lifetime of SheetLoadData. r=heycam
Saving a refcount bump is not worth the churn. Use a proper RefPtr<>
everywhere instead of manual refcounting, and don't make DoSheetComplete call
NS_RELEASE unconditionally.

Also, make clear by using references where null is expected or not.

Also, properly use a RefPtr in mPendingDatas, since they are strong pointers,
in fact.

Finally, remove some unused macros from nsCSSValue of which this code was the
last consumer.

Differential Revision: https://phabricator.services.mozilla.com/D41090

--HG--
extra : moz-landing-system : lando
2019-08-16 10:56:09 +00:00
Emilio Cobos Álvarez 588365a846 Bug 1571530 - Don't use nsBaseHashtable in the CSS loader. r=heycam
It's a refptr hashtable, really.

Differential Revision: https://phabricator.services.mozilla.com/D41027

--HG--
extra : moz-landing-system : lando
2019-08-16 10:56:07 +00:00
Emilio Cobos Álvarez 6779b66f01 Bug 1571530 - Remove various bool arguments in sheet loader APIs. r=heycam
They're bad, specially if they do vastly different thing in overloaded
functions, like aUseSystemPrincipal and aIsPreload. :)

Differential Revision: https://phabricator.services.mozilla.com/D40851

--HG--
extra : moz-landing-system : lando
2019-08-16 10:56:05 +00:00
Emilio Cobos Álvarez 2353359865 Bug 1571530 - Make Loader APIs return a Result. r=heycam
On the fence on this one, but I do think it's nicer.

Differential Revision: https://phabricator.services.mozilla.com/D40850

--HG--
extra : moz-landing-system : lando
2019-08-16 10:56:03 +00:00
Emilio Cobos Álvarez 353176ffe4 Bug 1571530 - Move inline sheet creation somewhere else that isn't CreateSheet. r=heycam
It doesn't do much for them.

Differential Revision: https://phabricator.services.mozilla.com/D40847

--HG--
extra : moz-landing-system : lando
2019-08-16 10:55:56 +00:00
Emilio Cobos Álvarez 70e10752be Bug 1571530 - Cleanup CreateSheet so that it returns its arguments rather than having outparams. r=heycam
Also, it's infallible, so no need to have an error state.

Differential Revision: https://phabricator.services.mozilla.com/D40693

--HG--
extra : moz-landing-system : lando
2019-08-16 10:55:54 +00:00
Emilio Cobos Álvarez 6c780690be Bug 1571530 - Factor out the stylesheet cache bits. r=heycam
Just moving code around but hopefully the new code is nicer :)

Also fix a regression I introduced in D40691 where the parsing mode wouldn't be
checked for XUL sheets.

Differential Revision: https://phabricator.services.mozilla.com/D40692

--HG--
extra : moz-landing-system : lando
2019-08-16 10:55:50 +00:00
Emilio Cobos Álvarez b8a075dada Bug 1554777 - Use SIZE_AVAILABLE rather than loaded to figure out whether to try to draw a border image. r=tnikkel
The current code needs to handle incomplete draws already due to async decoding,
and this prevents the race condition where we paint between the size-available
and load notifications, as the CSS image loader only invalidates for the first.

Once we try to decode the image at least once, then we'd repaint properly from
ImageLoader::OnFrameComplete.

Differential Revision: https://phabricator.services.mozilla.com/D41006

--HG--
extra : moz-landing-system : lando
2019-08-15 19:03:06 +00:00
Emilio Cobos Álvarez 4b2cd8f291 Bug 1554777 - Call SchedulePaint() rather than MarkNeedsDisplayItemRebuild() when we get the size available notification for a style image. r=mattwoodrow,tnikkel
So the issue here is that this test-case has a zero-sized border, but still with
a border-image (which we should paint).

So the first time we get here, the image is not loaded, and thus we don't get
here:

  https://searchfox.org/mozilla-central/rev/e0b0c38ee83f99d3cf868bad525ace4a395039f1/layout/painting/nsDisplayList.h#4254

Which means that we end up with zero bounds and thus we don't even get to the
border painting code.

However, when the image loads, we get to MarkNeedsDisplayItemRebuild(), but that
doesn't schedule any paint, only marks the frames as modified in order for
display items to be rebuilt _eventually_.

Thus eventually, where we force a repaint by other means, we paint correctly.

This only works in more general cases because we get to the nsImageRenderer code
which does vastly different stuff.

InvalidateFrame() seems to do the right thing and schedule a paint, so use it.
It's not clear to me which one of nsIFrame::InvalidateFrame() or
nsIFrame::SchedulePaint() we should use...

If I understand correctly, InvalidateFrame() will only do something iff there
are display items for the frame, so that should make the IsVisible() check
redundant.

Note however that I think there's still a race condition, if we get to paint in
between the SIZE_AVAILABLE notification (the one where we actually invalidate
the display items), and the LOAD notification (the one the border-image code
checks).

I'll send a separate patch for that, I think SIZE_AVAILABLE should be a
strong-enough hint and that allows us to remove nsStyleImage::IsLoaded()...

The RequestReflow stuff also looks highly suspicious... shape-outside
sync-decodes, and it seems we could end up invalidating reflow from the reflow
code...

Differential Revision: https://phabricator.services.mozilla.com/D41005

--HG--
extra : moz-landing-system : lando
2019-08-15 19:03:18 +00:00
Emilio Cobos Álvarez bb6b92b5f7 Bug 1574179 - Simplify <img align> rules in quirks.css. r=jfkthame
It seems to me that it should be equivalent, and we don't need to do
directionality-dependent stuff. align=right and align=left map to the physical
values anyway:

  https://searchfox.org/mozilla-central/rev/3366c3d24f1c3818df37ec0818833bf085e41a53/dom/html/nsGenericHTMLElement.cpp#1165

This also matches Chromium:

  https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/resources/quirks.css?l=26&rcl=e019448580f331c4c7c756271843d1bcf27e0071

(Modulo the case-insensitivity)

Differential Revision: https://phabricator.services.mozilla.com/D42142

--HG--
extra : moz-landing-system : lando
2019-08-15 19:26:02 +00:00
Mats Palmgren 22f32f1001 Bug 1574107 - Remove nsIFrame::IsBlockInside since it's dead code. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D42088

--HG--
extra : moz-landing-system : lando
2019-08-16 06:29:59 +00:00
Mats Palmgren 1f1f009b71 Bug 1574060 - Implement layout for 'display: flow-root list-item'. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D42087

--HG--
extra : moz-landing-system : lando
2019-08-16 06:30:24 +00:00
Frédéric Wang 3aec893f88 Bug 1574087. Make MathML length, dir, display, displaystyle and mathvariant case insensitive. r=emilio
See https://github.com/mathml-refresh/mathml/issues/22

* mathml/relations/css-styling/attribute-mapping-001.html (length, dir)
* mathml/relations/html5-tree/display-1.html (display)
* mathml/relations/css-styling/displaystyle-1.html (displaystyle)
* mathml/relations/css-styling/displaystyle-2.html (displaystyle)
* mathml/relations/css-styling/mathvariant-case-sensitivity.html (mathvariant)

layout/reftests/bugs/355548-3.xml has been updated now that units are case
insensitive.

Note:
* mathml/relations/css-styling/attribute-mapping-002.html also checks
  case insensitiveness of mathvariant and displaystyle but for now we map
  these attributes to internal -moz-* CSS properties.
* mathcolor and mathbackground values are already case insensitive, this
  is verified by mathml/relations/css-styling/attribute-mapping-001.html

Differential Revision: https://phabricator.services.mozilla.com/D42081

--HG--
extra : moz-landing-system : lando
2019-08-15 18:44:36 +00:00
Nicholas Nethercote 14e8c9129a Bug 1573720 - Convert layers.force-active to a static pref. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D41916

--HG--
extra : moz-landing-system : lando
2019-08-15 05:30:37 +00:00
Emilio Cobos Álvarez d8298290d7 Bug 1574101 - Use the right parent frame for `block ruby` if it's out of flow. r=mats
I should've caught this when reviewing, in fairness.

Differential Revision: https://phabricator.services.mozilla.com/D42163

--HG--
extra : moz-landing-system : lando
2019-08-15 22:21:35 +00:00
Daniel Holbert 0a772dbcbb Bug 1574310: clang-reformat the layout directory. (no review, just doing automated reformatting)
This patch is auto-generated by the following command:
./mach clang-format -p layout/

Differential Revision: https://phabricator.services.mozilla.com/D42218

--HG--
extra : moz-landing-system : lando
2019-08-15 22:13:49 +00:00
Noemi Erli 7244716bb5 Backed out changeset 4d8eb840fc2e (bug 1574101) so it can reland without unrelated reformatting changes r=dholbert CLOSED TREE 2019-08-16 01:00:14 +03:00
Emilio Cobos Álvarez ad39790be6 Bug 1574101 - Use the right parent frame for `block ruby` if it's out of flow. r=mats
I should've caught this when reviewing, in fairness.

Differential Revision: https://phabricator.services.mozilla.com/D42163

--HG--
extra : moz-landing-system : lando
2019-08-15 21:14:34 +00:00
Hiroyuki Ikezoe 960b3694fd Bug 1573999 - Add fuzzy-if(Android) to css-ui-invalid/select/select-disabled-fieldset-2.html and remove fuzzy-if(Android) from css-ui-valid/select/select-disabled-fieldset-2.html. r=botond
The fuzzy-if added in bug 1508177 should have added to the test in
css-ui-invalid/ not the test in css-ui-valid/.

Differential Revision: https://phabricator.services.mozilla.com/D42072

--HG--
extra : moz-landing-system : lando
2019-08-15 14:58:51 +00:00
Ting-Yu Lin 206960605d Bug 1569701 Part 2 - Use ColumnSetWrapper's effective computed content block-size to impose constraint for ColumnSet. r=dbaron
Run broken-column-rule-1.html with column-span enabled because it was
regressed by Bug 1548100 Part 2, but fixed by this patch.

Differential Revision: https://phabricator.services.mozilla.com/D41907

--HG--
extra : moz-landing-system : lando
2019-08-15 16:59:13 +00:00
Ting-Yu Lin 0bc5f5330e Bug 1569701 Part 1 - Make BlockReflowInput::mConsumedBSize a constant, and delete it assessor method. r=dbaron
We always pass consumed block-size into BlockReflowInput's constructor
in nsBlockFrame::Reflow(). By making mConsumedBSize a constant, its
assessor method becomes redundant.

Update the documentation to reflect the reality that ConsumedBSize()
accumulates content block-size from all previous *continuations*, which
was done in Bug 1506293 Part 2.

Differential Revision: https://phabricator.services.mozilla.com/D41906

--HG--
extra : moz-landing-system : lando
2019-08-15 16:49:14 +00:00
Ting-Yu Lin e4c1298151 Bug 1569701 Part 0 - Use nscoord instead of int for contentBEnd in nsColumnSetFrame::ReflowChildren(). r=dbaron
Differential Revision: https://phabricator.services.mozilla.com/D41905

--HG--
extra : moz-landing-system : lando
2019-08-14 23:17:06 +00:00
Emilio Cobos Álvarez a27b5bf655 Bug 782551 - Remove two quirks that other browsers don't have. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D42148

--HG--
extra : moz-landing-system : lando
2019-08-15 15:57:42 +00:00
Emilio Cobos Álvarez e53cb2392a Bug 1567094 - Make WebRender look at visited dependent border colors. r=jrmuizel
We do have test coverage for this
(layout/style/test/test_visited_reftests.html), but it seems that that uses
snapshotWindow() / drawWindow() and that may not use the WR code paths? It seems
we may be missing a bit of test coverage there. Is this expected?

Differential Revision: https://phabricator.services.mozilla.com/D41935

--HG--
extra : moz-landing-system : lando
2019-08-15 14:18:59 +00:00
Emilio Cobos Álvarez c3325072d0 Bug 1567094 - Make GetVisitedDependentColor const-friendly. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D41934

--HG--
extra : moz-landing-system : lando
2019-08-15 03:01:01 +00:00
Emilio Cobos Álvarez cbf082a263 Bug 1567094 - Rename some arguments to avoid being unnecessarily verbose. r=jrmuizel
ComputedStyle* aComputedStyle doesn't provide any extra value over just aStyle.

Lots of these should be const and what not, oh well.

Differential Revision: https://phabricator.services.mozilla.com/D41933

--HG--
extra : moz-landing-system : lando
2019-08-15 03:01:01 +00:00
Emilio Cobos Álvarez 5bc7d1be4c Bug 1567094 - Fix non-unified build in nsCSSRendering.cpp. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D41932

--HG--
extra : moz-landing-system : lando
2019-08-15 03:01:01 +00:00
Mats Palmgren a74c7c2d43 Bug 1574123 - Use nsLayoutUtils::GetMarkerFrame() more to avoid manual null-checks. r=emilio
(This basically addresses the review comments that I missed in
bug 1105868 part 4. My bad.)

Differential Revision: https://phabricator.services.mozilla.com/D42134

--HG--
extra : moz-landing-system : lando
2019-08-15 14:23:37 +00:00
Emilio Cobos Álvarez 66c0a4fa9b Bug 1572246 - Make <link> always unvisited. r=bzbarsky
Intent email: https://groups.google.com/d/msg/mozilla.dev.platform/1NP6oJzK6zg/ftAz_TajAAAJ

For now do the obvious check rather than bigger refactorings, since we keep them
matching :link or not depending on whether they have an href.

I'll file an HTML spec issue about not making them traversable, and a MathML
issue about the craziness that it is that almost all MathML elements can be
links.

Differential Revision: https://phabricator.services.mozilla.com/D41269

--HG--
extra : moz-landing-system : lando
2019-08-15 14:10:07 +00:00
Mihai Alexandru Michis 356b38ead4 Backed out changeset 1dccb45167d3 (bug 1574087) for causing reftest failures in 355548-3.xml 2019-08-15 15:29:09 +03:00
Emilio Cobos Álvarez 4f6b095d76 Bug 1573907 - Make non-list-items not increment the start value for <ol reversed>. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D42084

--HG--
extra : moz-landing-system : lando
2019-08-15 09:54:21 +00:00
Emilio Cobos Álvarez 7a80495d54 Bug 1573907 - Fix interaction of <li value> inside <ol reversed>. r=mats
The counting code was incrementing the start counter twice for <li value>, as it
generates both an increment and a reset.

We should instead only increment it once per list-item, that is, once per
increment.

Differential Revision: https://phabricator.services.mozilla.com/D42001

--HG--
extra : moz-landing-system : lando
2019-08-15 09:52:28 +00:00
Brindusan Cristian d674f265db Merge mozilla-central to autoland. a=merge CLOSED TREE
--HG--
rename : layout/reftests/mathml/dir-6-ref.html => testing/web-platform/tests/mathml/presentation-markup/direction/direction-006-ref.html
2019-08-15 12:50:36 +03:00
Brindusan Cristian 3a61fb322f Merge inbound to mozilla-central. a=merge 2019-08-15 12:45:55 +03:00
Emilio Cobos Álvarez 21744a9708 Bug 1571764 - Subtract combobox display frame border-padding when inferring the height from line-height. r=mats,jfkthame
This fixes it and seems to be an acceptable fix... Should I make it conditional
on box-sizing: border-box for completeness?  The display frame has border-box
box-sizing, and not having it would be a bug, I'd think...

Differential Revision: https://phabricator.services.mozilla.com/D41939

--HG--
extra : moz-landing-system : lando
2019-08-15 09:41:15 +00:00
Bogdan Tara 745a1d73ea Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE 2019-08-15 01:06:23 +03:00
Mats Palmgren aa7733da8b Bug 1557825 part 2 - Add tests and update devtools for 'display:block ruby'. r=xidorn
Differential Revision: https://phabricator.services.mozilla.com/D40213

--HG--
extra : moz-landing-system : lando
2019-08-14 14:38:33 +00:00
Mats Palmgren c784db904f Bug 1557825 part 1 - Implement 'display:block ruby'. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D40211

--HG--
extra : moz-landing-system : lando
2019-08-14 14:38:31 +00:00
Mats Palmgren c766e6e2e9 Bug 1105868 part 5 - Add / update tests for inline list-item 'display' values. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39834

--HG--
extra : moz-landing-system : lando
2019-08-14 14:37:23 +00:00
Mats Palmgren 53321dfa54 Bug 1105868 part 4 - Accessibility support for inline list-items. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39833

--HG--
extra : moz-landing-system : lando
2019-08-14 14:37:16 +00:00
Mats Palmgren 740cfc08a3 Bug 1105868 part 3 - Implement 'inline list-item' and 'inline flow-root list-item' values for the 'display' property. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39832

--HG--
extra : moz-landing-system : lando
2019-08-14 14:37:03 +00:00
Mats Palmgren be3d9812c0 Bug 1105868 part 2 - Use nsStyleDisplay::DisplayInside() in a few places to prepare for inline list-items. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39831

--HG--
extra : moz-landing-system : lando
2019-08-14 14:36:53 +00:00