Commit Graph

3360 Commits

Author SHA1 Message Date
Thomas Dolezal
1d175a57fd Bug 1611733 - Bug 1611633 - convert ns style position defines to enum class. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61958
2020-02-07 12:35:30 +00:00
Emilio Cobos Álvarez
709a8692aa Bug 1611701 - Tweak NODE_IS_EDITABLE flag handling for NAC so that it works consistently for <input type=number>. r=bzbarsky,masayuki,whimboo
I thought this would fix <input type=number style="user-select: none">, but
turns out it doesn't.

<input type=number> doesn't have the editor root as a root of the anonymous
subtree, so the current hack wouldn't work, as the anon root wouldn't have the
editable flag. So tweak the code a bit to handle stuff in a simpler way than
setting the flags after the fact, and set the NAC-root flag earlier to avoid
the mOuterWrapper->AppendChildTo(root) call forgetting about root's flags.

I had to tweak one AccessibleCaret test, but that's because it uses <textarea>
with user-select: none, and our behavior there is not particularly sane. It just
happened to work because that test-case also had a bunch of contenteditable
elements, and we stop matching this rule:

  https://searchfox.org/mozilla-central/rev/220a3bd6063fcbe5ca50e88dcabdc7dee0aca448/layout/style/contenteditable.css#22

Because the anonymous div now properly matches :-moz-read-write, which made the
rule apply and the test work. See comment 4 of this bug.

I'll fix this stuff up and add some tests for our behavior here in bug 1611699.

I refactored the dragdrop tests to cover more input types, but I ended up not
being able to use them because they're dependent on the content.

Instead I added an extra test and changed the refactor so that it applies to
<input type=search>, as there's layout work going on in bug 558594, and it'd be
unfortunate to regress this there too.

Differential Revision: https://phabricator.services.mozilla.com/D61094
2020-02-06 22:15:19 +00:00
Emilio Cobos Álvarez
fea80addd7 Bug 1613349 - Rename nsINode::DeleteProperty to RemoveProperty. r=smaug
And the related methods as well.

Differential Revision: https://phabricator.services.mozilla.com/D61768
2020-02-06 16:06:49 +00:00
Emilio Cobos Álvarez
c7c1186c47 Bug 1613349 - Rename nsIFrame::DeleteProperty to RemoveProperty. r=dholbert
As it doesn't necessarily call delete and that may be confusing.

Differential Revision: https://phabricator.services.mozilla.com/D61764
2020-02-06 16:06:49 +00:00
Emilio Cobos Álvarez
d114a3765d Bug 1613349 - Make nsIFrame::TakeProperty MOZ_MUST_USE. r=dholbert
Depends on D61756

Differential Revision: https://phabricator.services.mozilla.com/D61757
2020-02-06 00:39:10 +00:00
Emilio Cobos Álvarez
4714f59f93 Bug 1613349 - Rename nsINode::UnsetProperty to nsINode::TakeProperty. r=smaug
For consistency with the previous change for layout.

Depends on D61755

Differential Revision: https://phabricator.services.mozilla.com/D61756
2020-02-05 22:26:20 +00:00
Emilio Cobos Álvarez
096deac0e1 Bug 1613349 - Rename nsIFrame::RemoveProperty to nsIFrame::TakeProperty. r=dholbert
This is hopefully clearer naming.

Differential Revision: https://phabricator.services.mozilla.com/D61755
2020-02-06 00:13:38 +00:00
Tim Nguyen
06304d84e0 Bug 1610404 - Remove nsGroupBoxFrame (display: -moz-groupbox). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61422
2020-02-03 09:55:51 +00:00
Eric Rahm
53df32d84e Bug 1610387 - Remove nsAutoPtr usage from layout/. r=dbaron
Differential Revision: https://phabricator.services.mozilla.com/D60455
2020-02-01 09:40:36 +00:00
Nazım Can Altınova
6c84e9b60a Bug 1609708 - Rename PROFILER_TRACING to PROFILER_TRACING_MARKER. r=gerald
Depends on D60229

Differential Revision: https://phabricator.services.mozilla.com/D60231
2020-01-17 21:29:15 +00:00
Emilio Cobos Álvarez
02472ef6d7 Bug 1561900 - Fix scroll state restoration when not coming from the bfcache on the initial frame construction. r=bzbarsky
There is no way this ever properly worked, as we always passed null for
`aFrameState`.

So it'd only work if we reframed the document element or such...  Which is not
amazing.

For simpler test-cases, when we don't construct the scrollframe via
PresShell::Initialize, but via the regular frame constructor updates
(ContentAppended, etc...), those end up working because we go through lazy frame
construction, which ends up in RecreateFramesForContent, which passes
mTempFrameTreeState.

Differential Revision: https://phabricator.services.mozilla.com/D59569
2020-01-15 13:18:52 +00:00
Brian Grinstead
6e4924aab9 Bug 1596485 - Rename mXBLInvolved to mShadowDOMInvolved and XBLInvolved to ShadowDOMInvolved r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D59071
2020-01-08 15:08:06 +00:00
Emilio Cobos Álvarez
8e1b7f6cc2 Bug 1606130 - Make display: -moz-box more similar to other display types for block layout. r=jfkthame,surkov
It is unexpected (see bug) that a -moz-box is affected by baseline alignment.
Make -moz-box be block-outside, and -moz-inline-box be inline-outside, instead
of the bespoke thing we have now.

This is more similar to everything else, and fixes the bug.

Differential Revision: https://phabricator.services.mozilla.com/D58726
2020-01-07 21:00:42 +00:00
Bogdan Tara
6da2ee37ed Backed out changeset 23d862866f3a (bug 1606130) for android crashtest complaining about 1547420-1.html 2020-01-07 22:53:10 +02:00
Emilio Cobos Álvarez
50be243e46 Bug 1606130 - Make display: -moz-box more similar to other display types for block layout. r=jfkthame,surkov
It is unexpected (see bug) that a -moz-box is affected by baseline alignment.
Make -moz-box be block-outside, and -moz-inline-box be inline-outside, instead
of the bespoke thing we have now.

This is more similar to everything else, and fixes the bug.

Differential Revision: https://phabricator.services.mozilla.com/D58726
2020-01-07 18:02:05 +00:00
Emilio Cobos Álvarez
aab1464a8a Bug 1605803 - Use cbindgen for content property. r=xidorn
This cleans up and also allows us to keep the distinction between content: none
and content: normal, which allows us to fix the computed style we return from
getComputedStyle().

Do this last bit from the resolved value instead of StyleAdjuster, because
otherwise we need to tweak every initial struct for ::before / ::after.

Differential Revision: https://phabricator.services.mozilla.com/D58276
2020-01-05 13:10:39 +00:00
Tetsuharu OHZEKI
893482215f Bug 1597465 - Fix uses of nsCSSFrameConstructor::FindXULMenubarData in layout/base/nsCSSFrameConstructor.cpp. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D58482
2020-01-03 14:57:14 +00:00
Ting-Yu Lin
43341db36d Bug 1499281 - Remove column-span pref in nsCSSFrameConstructor. r=dbaron
For BeginBuildingColumns, returning nsBlockFrame, i.e. the original
NS_NewColumnSetWrapperFrame's return type, should be sufficient since no
other caller in frame constructor needs to call ColumnSetWrapper's
methods.

Differential Revision: https://phabricator.services.mozilla.com/D58398
2019-12-31 16:13:41 +00:00
Emilio Cobos Álvarez
a9a9d605f8 No bug - Remove a comment that referenced XBL.
And fix a typo while at it.

Differential Revision: https://phabricator.services.mozilla.com/D58340
2019-12-28 02:43:04 +00:00
Chris Peterson
0a9155f83b Bug 1570499 - Part 1: Replace MOZ_FALLTHROUGH macro with C++17's [[fallthrough]] attribute. r=froydnj
This changeset is a simple find and replace of `MOZ_FALLTHROUGH` and `[[fallthrough]]`.

Unfortunately, the MOZ_FALLTHROUGH_ASSERT macro (to assert on case fallthrough in debug builds) is still necessary after switching from [[clang::fallthrough]] to [[fallthrough]] because:

* MOZ_ASSERT(false) followed by [[fallthrough]] triggers a -Wunreachable-code warning in DEBUG builds
* but MOZ_ASSERT(false) without [[fallthrough]] triggers a -Wimplicit-fallthrough warning in NDEBUG builds.

Differential Revision: https://phabricator.services.mozilla.com/D56440
2019-12-20 07:16:43 +00:00
Emilio Cobos Álvarez
9f976bb6e6 Bug 1581467 - Do not use synthetic display-inside values. r=TYLin
This matches the new servo layout engine too, and thus removes some #[cfg]
gunk.  Just use `flow` since it doesn't simplify the layout code as much.

Differential Revision: https://phabricator.services.mozilla.com/D45973
2019-12-19 01:19:04 +00:00
Mats Palmgren
16ff277d0b Bug 1604771 - Remove the eSVGForeignObject IsFrameOfType bit. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D57621
2019-12-18 16:00:47 +00:00
Mats Palmgren
7b5803d9b5 Bug 1604668 - Remove the eExcludesIgnorableWhitespace IsFrameOfType bit. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D57569
2019-12-18 01:41:20 +00:00
jeffin143
daf9859748 Bug 1601856 : convert NS_STYLE_VISIBILITY_* to an enum class in nsStyleConsts.h r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D56140
2019-12-13 05:34:38 +00:00
jeffin143
d3b5feefb7 Bug 1601990 : convert NS_STYLE_POINTER_EVENTS_* to an enum class in nsStyleConsts.h r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D56203
2019-12-12 10:24:16 +00:00
jeffin143
fbb2ed37ee Bug 1600476 : convert NS_STYLE_TOP_LAYER_* to an enum class in nsStyleConsts.h r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D55377
2019-12-01 13:05:55 +00:00
Mats Palmgren
660fcb26bb Bug 471015 - [css-break] Implement <fieldset> fragmentation. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D53709
2019-11-25 21:45:22 +00:00
Brindusan Cristian
a43400a7da Backed out changeset 0186165ee1d8 (bug 471015) for reftest failures at box-shadow/611574-1.html. CLOSED TREE 2019-11-25 21:40:19 +02:00
Mats Palmgren
2e0c35f477 Bug 471015 - [css-break] Implement <fieldset> fragmentation. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D53709
2019-11-25 18:05:16 +00:00
Tim Nguyen
1da29fc40a Bug 1576946 - Remove nsStackFrame platform code. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D49487
2019-11-12 19:50:19 +00:00
Mats Palmgren
82d8c79fa6 Bug 1595103 - [css-pseudo] Skip all ::marker boxes when finding content for a ::first-letter. r=emilio
Per discussion in:
https://github.com/w3c/csswg-drafts/issues/4503

Differential Revision: https://phabricator.services.mozilla.com/D52544
2019-11-11 19:28:34 +00:00
Brendan Dahl
e646772cea 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-08 23:34:08 +00:00
Noemi Erli
aa45dd3a98 Backed out 7 changesets (bug 1492582) for causing ss mochitest failures CLOSED TREE
Backed out changeset 1484255e5f4d (bug 1492582)
Backed out changeset bbf62ef50e52 (bug 1492582)
Backed out changeset 836724d3860e (bug 1492582)
Backed out changeset 5efddfd196b5 (bug 1492582)
Backed out changeset d4be1aa8cdb6 (bug 1492582)
Backed out changeset f05dfbeff17b (bug 1492582)
Backed out changeset e0e56a195659 (bug 1492582)
2019-11-07 21:51:46 +02:00
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