Commit Graph

3327 Commits

Author SHA1 Message Date
Brendan Dahl
43d0b2e498 Bug 1492582 - Don't create scroll frames for windows that don't need them. r=emilio
When browser.xhtml switches to an <html> root element, the frame structure
changed and caused performance regressions on talos for tart and tresize.
browser.xhtml doesn't need scrolling, so we can disable it and keep performance
on par with XUL <window>.

Differential Revision: https://phabricator.services.mozilla.com/D50675
2019-11-07 16:21:23 +00:00
Ting-Yu Lin
a7201ab84c Bug 1593752 - When inserting canonical <body> element, reframe root element only if their used WritingModes are different. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D51889
2019-11-06 05:50:12 +00:00
Alex Catarineu
65042da62b Bug 1581537 - Avoid several browser language leaks r=smaug
Spoof dom/dom.properties, layout/xmlparser.properties,
layout/MediaDocument.properties to en-US if needed.

Differential Revision: https://phabricator.services.mozilla.com/D46034
2019-11-04 16:56:27 +00:00
Mihai Alexandru Michis
6be7f1be0b Backed out changeset 1d87c269da8a (bug 1581537) for causing bc failures in browser_misused_characters_in_strings.js CLOSED TREE 2019-11-04 16:06:37 +02:00
Alex Catarineu
884665353f Bug 1581537 - Avoid several browser language leaks r=smaug
Spoof dom/dom.properties, layout/xmlparser.properties,
layout/MediaDocument.properties to en-US if needed.

Differential Revision: https://phabricator.services.mozilla.com/D46034
2019-11-04 11:27:59 +00:00
Emilio Cobos Álvarez
6cc2dd452f Bug 1591297 - Remove XBL binding loading code in the frame constructor. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D50555
2019-10-25 18:46:59 +00:00
Ting-Yu Lin
95145c8845 Bug 1588025 - Change an argument to nsContainerFrame* for ConstructAnonymousContentForCanvas. r=jfkthame
The only caller SetRootElementFrameAndConstructCanvasAnonContent()
already passes nsContainerFrame* to aFrame.

A minor cleanup discovered while working on this bug.

Differential Revision: https://phabricator.services.mozilla.com/D48943
2019-10-28 20:40:30 +00:00
Tim Nguyen
09876c73aa Bug 1590897 - Remove support for XUL <spring> element. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D50440
2019-10-24 14:55:25 +00:00
Tim Nguyen
581f73d523 Bug 1590903 - Remove support for XUL <text> element. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D50368
2019-10-24 06:23:10 +00:00
Cameron McCormack
f0820a7e04 Bug 1585880 - Ensure pointer-events inherits into scrollbar parts. r=emilio
Like visibility, we rely on pointer-events values inheriting down into
scrollbar part elements.  So don't cached NAC styles for scrollbar parts
if we have a non-initial value for pointer-events, and adjust the UA
style sheet rules to ensure it is always inherited.

Differential Revision: https://phabricator.services.mozilla.com/D49359
2019-10-16 08:20:56 +00:00
Ting-Yu Lin
6602487740 Bug 992384 - Make sure we always propagate root element's mWritingMode. r=emilio
Bug 1102175 Part 1 only handles HTML documents correctly because they
always have a body element (even if the <body> tag is not written
explicitly in the document). For SVG documents and all other documents
lacking <body> element, we always want to propagate mWritingMode from
the root element, which is our old behavior prior to Bug 1102175.

Note that mDocElementContainingBlock (i.e. nsCanvasFrame) is using
viewport's style, so we need to use the root element's computed style to
compute WritingMode for propagating.

Differential Revision: https://phabricator.services.mozilla.com/D49695
2019-10-18 09:16:01 +00:00
Frederic Wang
d453b1f624 Bug 1587577 - Remove support for the mfenced element. r=emilio
See https://groups.google.com/forum/#!topic/mozilla.dev.platform/DHO72glZxA0

Differential Revision: https://phabricator.services.mozilla.com/D49320
2019-10-17 15:53:31 +00:00
Emilio Cobos Álvarez
98295dcb15 Bug 1588486 - Fix whitespace skipping inside inlines to handle display: contents correctly. r=mats
This also unifies the code a bit more.

Differential Revision: https://phabricator.services.mozilla.com/D49139
2019-10-14 17:38:43 +00:00
Emilio Cobos Álvarez
ae3c7d26a8 Bug 1588486 - Don't generate frames for children display: contents is used within SVG text. r=mats
The TextNodeCorrespondenceRecorder stuff doesn't handle display: contents or
Shadow DOM at all. This causes a failure with an upcoming patch.

This patch fixes it and fixes related crashes like bug 1563779. This is the same
wallpaper as bug 1421807.

Differential Revision: https://phabricator.services.mozilla.com/D49138
2019-10-14 17:38:41 +00:00
Emilio Cobos Álvarez
b560263d99 Bug 1581467 - Fix checks for display: inline{,-block} which don't account for inline list items. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D48346
2019-10-12 21:05:16 +00:00
Ting-Yu Lin
43e77ce9f1 Bug 1587624 - Add a console log when we propagate principal writing-mode from <body>. r=emilio
I use `warningFlag` instead of `infoFlag` because even if the principal
writing-mode propagation is written in the spec, its effect might
surprise the developers.

Differential Revision: https://phabricator.services.mozilla.com/D48774
2019-10-10 17:58:33 +00:00
Emilio Cobos Álvarez
5edac25bb5 Bug 1578844 - Fix various issues with display: contents within svg text. r=mats
I'm not happy about all the SVG text / disallow out of flow complexity sprinkled
during frame construction... :(

Maybe we should add some kind of more generic mechanism to disallow some
children for particular kinds of frames, or something.

Co-authored-by: Mats Palmgren <mats@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D44808
2019-10-12 16:28:13 +00:00
Ting-Yu Lin
5fefff9390 Bug 1102175 Part 1 - Propagate used writing-mode from body element to its ancestors. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D45481
2019-10-10 04:44:44 +00:00
Gurzau Raul
1b7047f374 Backed out 4 changesets (bug 1102175) for Android reftest failures at font-inflation-1a.html
Backed out changeset 33914610f60f (bug 1102175)
Backed out changeset 004a0cb8af9f (bug 1102175)
Backed out changeset 2ac28b335c3c (bug 1102175)
Backed out changeset 50b041e06f23 (bug 1102175)
2019-10-10 07:40:38 +03:00
Ting-Yu Lin
07000ca10b Bug 1102175 Part 1 - Propagate used writing-mode from body element to its ancestors. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D45481
2019-10-09 22:11:02 +00:00
Brendan Dahl
bf272a3bca Bug 1510785 - Only build XBL related code when MOZ_XBL is defined. r=bzbarsky
When XBL is disabled, no code in dom/xbl will be built. Also, adds ifdefs
to remove any of the XBL related code elsewhere. There's definitely more
that can be done here, but I think it's better to wait to do the rest of
the cleanup when we actually remove the code.

Depends on D45612

Differential Revision: https://phabricator.services.mozilla.com/D45613
2019-10-08 23:52:14 +00:00
Emilio Cobos Álvarez
e25bb5100d Bug 1581467 - Use DisplayInside() / DisplayOutside() a bit more. r=mats
And remove some unused display values from the C++ bindings.

Differential Revision: https://phabricator.services.mozilla.com/D45974
2019-10-07 12:27:27 +00:00
Sylvestre Ledru
49802d0a8e Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D47737
2019-10-06 18:29:55 +00:00
Daniel Holbert
6ff2001dc3 Bug 1584638: Relax -mox-box blockification assertions to be debug-only. r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D47505
2019-09-27 21:31:04 +00:00
Daniel Holbert
afb15161af Bug 1584187: Pass an assertion-only variable to mozilla::Unused, to fix non-nightly opt build error. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D47319
2019-09-26 21:11:33 +00:00
Daniel Holbert
fec22de422 Bug 1582819: Add diagnostic assert to catch positioned elements with display:-moz-box or -moz-inline-box that were previously blockified to 'block' but won't be anymore. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D46681
2019-09-25 20:38:55 +00:00
Ting-Yu Lin
0e45ab1630 Bug 1580576 - Remove an assertion to check <details> element's frame type when reframing. r=emilio
If a <details> is a multi-column container, and has a column-span child
inside, aFrame can be ColumnSetWrapper or column-span-wrapper frame (due
to GetInsertionPrevSibling()'s modification). The latter case is handled
by "Situation #5 in WipeContainingBlock(), and can be reproduced by
changing `<article>` tag to `<details>` in
testing/web-platform/tests/css/css-multicol/multicol-span-all-dynamic-add-005.html

In any case, aFrame might end up in a frame generated by the <details>
element. I feel the assertion to check frame types might not be very
useful. Let's remove it.

Differential Revision: https://phabricator.services.mozilla.com/D45585
2019-09-11 21:52:40 +00:00
Ting-Yu Lin
1de8acee2e Bug 1579953 - Check details element to determine whether to reframe. r=emilio
If the <details> has ::first-letter, insertion.mParentFrame may be
modified by GetInsertionPrevSibling(), and points to nsFirstLetterFrame.

Fortunately, nsFirstLetterFrame's content is the details element. We can
check the content to determine if reframing the <details> is needed.

Also, add a reftest to test that an appended text should apply styles in
details::first-line.

Differential Revision: https://phabricator.services.mozilla.com/D45454
2019-09-11 00:04:26 +00:00
Ting-Yu Lin
f9e43f6a72 Bug 1523582 Part 2 - Make -moz-column-content a BFC when column-span is enabled. r=dbaron
Based on CSS working group's resolution in
https://github.com/w3c/csswg-drafts/issues/2582#issuecomment-402619872,
column-boxes are BFC.

Add NS_BLOCK_FORMATTING_CONTEXT_STATE_BITS to -moz-column-content, but
only for the new multicol layout.

Differential Revision: https://phabricator.services.mozilla.com/D43904
2019-09-09 17:42:12 +00:00
Mats Palmgren
76728bbb7f Bug 1574552 - Push float/abs.pos. CB for 'block ruby' as needed. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D42701
2019-08-20 21:28:01 +00:00
Mats Palmgren
66432bdda6 Bug 1574994 part 2 - Remove display:-moz-inline-grid/-moz-inline-stack. r=emilio
Depends on D42551

Differential Revision: https://phabricator.services.mozilla.com/D42552
2019-08-19 21:19:04 +00:00
Emilio Cobos Álvarez
00c82387ac Bug 1574544 - Remove now-unnecessary condition that makes the frame constructor get confused with editor anonymous nodes. r=mats
This condition was needed when FindInsertionPrevSibling and co didn't understand
display: contents.

Editor is pretty broken (and calls into PresShell::ContentRemoved directly, and
incorrectly, using anonymous nodes).

In this case we were taking the XBL path because of display: contents, which
means that we tried to seek to the editor anonymous node, and crash (since it's
not an explicit kid).

Editor needs to get fixed, but this is technically more correct and fixes the
crash, so we may as well take it in the interim.

Differential Revision: https://phabricator.services.mozilla.com/D42472
2019-08-19 12:16:28 +00:00
Emilio Cobos Álvarez
c3215fc33d 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
2019-08-16 11:43:36 +00:00
Emilio Cobos Álvarez
cc3be970d3 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
2019-08-16 05:59:03 +00:00
Mats Palmgren
21e0017dd1 Bug 1574060 - Implement layout for 'display: flow-root list-item'. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D42087
2019-08-16 06:30:24 +00:00
Emilio Cobos Álvarez
23c61825eb 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
2019-08-15 22:21:35 +00:00
Daniel Holbert
8865537b64 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
2019-08-15 22:13:49 +00:00
Noemi Erli
025090856f 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
d4753dbfd7 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
2019-08-15 21:14:34 +00:00
Mats Palmgren
096cb3e48f Bug 1557825 part 1 - Implement 'display:block ruby'. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D40211
2019-08-14 14:38:31 +00:00
Mats Palmgren
fddfc948d1 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
2019-08-14 14:37:03 +00:00
Mats Palmgren
1b48239683 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
2019-08-14 14:36:53 +00:00
Mats Palmgren
7183051087 Bug 1105868 part 1 - Use nsStyleDisplay::IsListItem() in a few places to prepare for inline list-items. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39830
2019-08-14 14:36:18 +00:00
Mats Palmgren
1bb31cf3d5 Bug 1038294 part 14 - Use only the DisplayInside() value to decide which type of frame to create. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39766
2019-08-14 14:35:06 +00:00
Mats Palmgren
21e7f7c301 Bug 1038294 part 11 - Remove FindXULDisplayData and handle all display types in FindDisplayData instead. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39763
2019-08-14 14:34:19 +00:00
Mats Palmgren
3662d767ed Bug 1038294 part 10 - Remove dead code that handles display:none/contents which shouldn't reach FindDisplayData. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39762
2019-08-14 14:34:07 +00:00
Mats Palmgren
e9dfb6b089 Bug 1038294 part 9 - Move scroll box suppression inside the switch. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39761
2019-08-14 14:33:46 +00:00
Mats Palmgren
7ceebf967e Bug 1038294 part 8 - Move block box creation inside the switch together with all the other display types. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39760
2019-08-14 14:33:29 +00:00
Mats Palmgren
66904ea317 Bug 1038294 part 7 - Move XUL variants of '-moz-{inline-}box' from FindXULDisplayData to FindDisplayData. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39759
2019-08-14 14:33:16 +00:00
Mats Palmgren
2dbfa59daf Bug 1038294 part 6 - Simplify FindDisplayData by removing a now unnecessary lambda. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39758
2019-08-14 14:32:59 +00:00