Commit Graph

3303 Commits

Author SHA1 Message Date
longsonr
39b4bba787 Bug 1658455 - Remove eANIMATION and eFILTER from IsNodeOfType r=dholbert
- eANIMATION is the same as testing for SVGAnimationElement
- eFILTER is the same as testing for SVGFE

Differential Revision: https://phabricator.services.mozilla.com/D86695
2020-08-15 10:38:17 +00:00
Daniel Holbert
fafdaef2c0 Bug 1652278 part 2: Flesh out PrintedSheetFrame implementation so that it serves as the container for nsPageFrame. r=TYLin
This patch:
- Creates an anon-box pseudo-style for PrintedSheetFrame, in part so that it
  can co-opt the styles that we formerly gave to page-frames in ua.css, to draw
  the sheet of paper and the shadow in Print Preview.
- Adjusts nsCSSFrameConstructor to create a PrintedSheetFrame as the parent of
  nsPageFrame (inserting between it and its nsPageSequenceFrame container, in
  the frame tree).
- Fleshes out out a simple BuildDisplayList() implementation for
  PrintedSheetFrame (taking the responsibility for "paper"-drawing from
  nsPageFrame).
- Fleshes out a simple Reflow implementation for PrintedSheetFrame, just
  placing the child page (assuming there's only one for now) at the origin.
- Adjusts nsPageFrame and nsPageSequenceFrame to account for the fact that
  there's another layer between them now.

Note that PrintedSheetFrame needs to implement AppendDirectlyOwnedAnonBoxes()
(just as nsSimplePageSequence and nsPageFrame do), since it owns anonymous
nsPageFrame instances. This implementation only needs to append the first
child, as explained in the code-comment and in
https://bugzilla.mozilla.org/show_bug.cgi?id=1374761#c9 (and of course, for
now, PrintedSheetFrame only has one child at a time anyway.)

Differential Revision: https://phabricator.services.mozilla.com/D83457
2020-08-05 03:28:32 +00:00
Tim Nguyen
32742ae85a Bug 558594 - Implement layout for <input type='search'>. r=emilio,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D56302
2020-07-27 12:09:40 +00:00
longsonr
2762063acc Bug 1653848 - Make SVGPaintServer and SVGGradientFrames queryable r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D84102
2020-07-20 18:02:25 +00:00
longsonr
6299f4eaf7 Bug 1652194 - Remove SVGGenericContainerFrame r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D83257
2020-07-16 20:53:36 +00:00
Ting-Yu Lin
f630bc305b Bug 1422908 - Use fieldset frame itself as the aPositionedFrame argument on PushAbsoluteContainingBlock. r=mats
Per documentation, `aPositionedFrame` (the second argument) of
`PushAbsoluteContainingBlock` should be the frame whose style actually
makes the new absolute containing block a containing block, so it should
be the fieldset frame itself, not fieldset's inner frame.

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

Differential Revision: https://phabricator.services.mozilla.com/D82651
2020-07-14 17:49:05 +00:00
longsonr
ba1943ecf8 Bug 1259861 - Move everything else into the mozilla namespace in layout/svg r=dholbert
Also: adjust include paths to be consistent for usages of various SVG headers,
and remove unused SVG includes (mostly for "utils" classes),
and drop stray "ns" from already-renamed SVG classes in various code comments.

Differential Revision: https://phabricator.services.mozilla.com/D83140
2020-07-11 02:20:20 +00:00
Kagami Sascha Rosylight
93741338a8 Bug 1630704 - Part 27: Remove nsFrame from inheritance chain r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81864
2020-07-06 22:29:42 +00:00
Simon Giesecke
a69d79b6db Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Kagami Sascha Rosylight
0a3a447bbb Bug 1647525 - Use HasAnyStateBits() in remaining layout files r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81230
2020-06-28 01:00:19 +00:00
Kagami Sascha Rosylight
e59ebb4a53 Bug 1647525 - Use HasAnyStateBits() in nsCSSFrameConstructor r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81093
2020-06-25 14:23:35 +00:00
Ting-Yu Lin
9b94f53e72 Bug 1644819 Part 2 - Prevent a split frame from being a dynamic reflow root. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D79585
2020-06-13 04:04:13 +00:00
Emilio Cobos Álvarez
6350eead9d Bug 1640917 - Remove XBL mentions in layout. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D76846
2020-05-26 16:16:32 +00:00
Emilio Cobos Álvarez
b9fa2ce48d Bug 1640601 - Also reframe the closest non-anonymous root when switching anonymous content from display: none to something else. r=mats
We were dealing with it correctly when switching display from e.g. block
to inline, or such. But we were not dealing with it when the node was
undisplayed.

Handle it properly, and free one frame bit while at it. We can't really
do this for ManualNAC (the editor resizers) because they request a
reframe explicitly.

Differential Revision: https://phabricator.services.mozilla.com/D76679
2020-05-25 23:54:10 +00:00
Emilio Cobos Álvarez
b1fc84a629 Bug 1640605 - Remove IsInAnonymousSubtree / IsRootOfAnonymousSubtree. r=edgar
In favor of the NativeAnonymous versions which they forward to.

Done automatically with:

  rg -l 'IsInAnonymousSubtree' | xargs sed -i 's/IsInAnonymousSubtree/IsInNativeAnonymousSubtree/g'

And removing the function definitions afterwards.

Differential Revision: https://phabricator.services.mozilla.com/D76681
2020-05-25 11:43:51 +00:00
Emilio Cobos Álvarez
d052acd76c Bug 1640165 - Address TYLin's and clang-format's comments.
Differential Revision: https://phabricator.services.mozilla.com/D76556
2020-05-22 21:55:10 +00:00
Emilio Cobos Álvarez
6c2f6d5168 Bug 1640165 - Use EnumSet for frame construction item flags. r=mats
And remove the XBL_BASE flag because it's unused.

Differential Revision: https://phabricator.services.mozilla.com/D76474
2020-05-22 18:07:48 +00:00
Ting-Yu Lin
7bcfe0c60a Bug 1584890 Part 1 - Use nsFrameConstructorState::AddChild() to construct out-of-flow flex or grid container as the root element. r=dholbert
If `contentFrame` is out-of-flow, nsFrameConstructorState::AddChild() can
construct a placeholder frame for `contentFrame` and put the placeholder in
`frameList`.

Also, we need to use nsFrameConstructorState::GetGeometricParent() to
get the correct parent when calling InitAndRestoreFrame() for an
out-of-flow `contentFrame`. For example, if `contentFrame` has
position:fixed, its parent should be ViewportFrame, not
CanvasFrame (which is mDocElementContainingBlock).

This patch also adds reftests for position:absolute flex & grid root
element. Reftests for position:fixed root element are in the next part.

Differential Revision: https://phabricator.services.mozilla.com/D76205
2020-05-21 23:11:07 +00:00
Cosmin Sabou
ef60a1f745 Backed out 2 changesets (bug 1584890) for crashtest failures on 1608851.html. CLOSED TREE
Backed out changeset 3265c120177f (bug 1584890)
Backed out changeset 057922187f3d (bug 1584890)
2020-05-22 00:49:26 +03:00
Ting-Yu Lin
6e00825ced Bug 1584890 Part 1 - Use nsFrameConstructorState::AddChild() to construct out-of-flow flex or grid container as the root element. r=dholbert
If `contentFrame` is out-of-flow, nsFrameConstructorState::AddChild() can
construct a placeholder frame for `contentFrame` and put the placeholder in
`frameList`.

Also, we need to use nsFrameConstructorState::GetGeometricParent() to
get the correct parent when calling InitAndRestoreFrame() for an
out-of-flow `contentFrame`. For example, if `contentFrame` has
position:fixed, its parent should be ViewportFrame, not
CanvasFrame (which is mDocElementContainingBlock).

This patch also adds reftests for position:absolute flex & grid root
element. Reftests for position:fixed root element are in the next part.

Disable crashtest 1608851.html on Android because it causes OOM crash
after landing this patch.

Differential Revision: https://phabricator.services.mozilla.com/D76205
2020-05-21 18:38:59 +00:00
Csoregi Natalia
e4d0eeb5ff Backed out 2 changesets (bug 1584890) for crashtest failures on 1608851.html. CLOSED TREE
Backed out changeset 1da2faea06e8 (bug 1584890)
Backed out changeset 84d138356c76 (bug 1584890)
2020-05-21 04:05:52 +03:00
Ting-Yu Lin
f4a92243a1 Bug 1584890 Part 1 - Use nsFrameConstructorState::AddChild() to construct out-of-flow flex or grid container as the root element. r=dholbert
If `contentFrame` is out-of-flow, nsFrameConstructorState::AddChild() can
construct a placeholder frame for `contentFrame` and put the placeholder in
`frameList`.

Also, we need to use nsFrameConstructorState::GetGeometricParent() to
get the correct parent when calling InitAndRestoreFrame() for an
out-of-flow `contentFrame`. For example, if `contentFrame` has
position:fixed, its parent should be ViewportFrame, not
CanvasFrame (which is mDocElementContainingBlock).

This patch also adds reftests for position:absolute flex & grid root
element. Reftests for position:fixed root element are in the next part.

Differential Revision: https://phabricator.services.mozilla.com/D76205
2020-05-20 22:32:06 +00:00
Emilio Cobos Álvarez
73fd281e70 Bug 1584935 - Clean up a tiny bit more now that lazyfc is infallible. r=tnikkel
Fairly minor clean-up.

Differential Revision: https://phabricator.services.mozilla.com/D74751
2020-05-13 18:02:53 +00:00
Emilio Cobos Álvarez
fdb31fc148 Bug 1584935 - Enable lazy frame construction everywhere. r=tnikkel
This is only the minimal change, there's cleanup coming afterwards in
follow-up bugs.

Differential Revision: https://phabricator.services.mozilla.com/D74749
2020-05-13 18:02:52 +00:00
Csoregi Natalia
0b1a300610 Backed out 2 changesets (bug 1584935) for accessibility failures on e.g. accessible/tests/mochitest/tree/test_tabbrowser.xhtml CLOSED TREE
Backed out changeset 91e7137acba3 (bug 1584935)
Backed out changeset 28e2781f3026 (bug 1584935)
2020-05-13 09:41:36 +03:00
Emilio Cobos Álvarez
9a967f7bf1 Bug 1584935 - Clean up a tiny bit more now that lazyfc is infallible. r=tnikkel
Fairly minor clean-up.

Differential Revision: https://phabricator.services.mozilla.com/D74751
2020-05-12 22:41:55 +00:00
Emilio Cobos Álvarez
f59e343e84 Bug 1584935 - Enable lazy frame construction everywhere. r=tnikkel
This is only the minimal change, there's cleanup coming afterwards in
follow-up bugs.

Differential Revision: https://phabricator.services.mozilla.com/D74749
2020-05-12 22:41:55 +00:00
Bogdan Tara
8be4e678bb Backed out 2 changesets (bug 1584935) for many toolkit/content/tests/chrome/test_* failures CLOSED TREE
Backed out changeset e78fc5cb2ed7 (bug 1584935)
Backed out changeset 8d7c5732cda9 (bug 1584935)
2020-05-12 03:03:58 +03:00
Emilio Cobos Álvarez
3117dfe9a8 Bug 1584935 - Clean up a tiny bit more now that lazyfc is infallible. r=tnikkel
Fairly minor clean-up.

Differential Revision: https://phabricator.services.mozilla.com/D74751
2020-05-11 22:52:16 +00:00
Emilio Cobos Álvarez
30b379ae2c Bug 1584935 - Enable lazy frame construction everywhere. r=tnikkel
This is only the minimal change, there's cleanup coming afterwards in
follow-up bugs.

Differential Revision: https://phabricator.services.mozilla.com/D74749
2020-05-11 22:52:23 +00:00
Emilio Cobos Álvarez
43fc8c5696 Bug 1634840 - Remove warning about inlines in XUL. r=dbaron
It's not like we're going to change behavior here anytime soon anymore
(other than removing XUL usage), and the helpfulness of the warning has
probably decreased with time.

But maybe I'm missing a reason why it should be kept around?

Differential Revision: https://phabricator.services.mozilla.com/D73544
2020-05-05 23:57:55 +00:00
Ting-Yu Lin
b030112d2f Bug 1630819 - Remove the logic to reframe root unconditionally when reframing body. r=emilio
For whatever reasons, we pass body element into
`RecreateFramesForContent`, the root element won't be reframed down in
the `ContentRemoved` path, but in `ContentRangeInserted()` path while
checking `WipeContainingBlock`. And in bug 1593752, we already have the
logic to reframe root element only when html and body's writing-modes
are different, so we won't over-eagerly reframe the root element.

Differential Revision: https://phabricator.services.mozilla.com/D71606
2020-04-20 18:03:14 +00:00
Chris H-C
bd97e241a8 Bug 40545 - Options to use label attribute when present r=emilio,jfkthame,mats
According to spec, option elements with label attributes should show and use
those labels rather than their element text. So let's do that.

Requires some trickery because the option element is a block element (so it
lays out its width based on its text content) so we put its label (if it has
one) in its ::before and skip frame generation so it measures the text of its
label, not of its text node children.

Differential Revision: https://phabricator.services.mozilla.com/D63545
2020-04-06 16:06:36 +00:00
Sylvestre Ledru
3ce73036e5 Bug 1519636 - Reformat recent changes to the Google coding style r=jgilbert
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D67574
2020-04-05 13:34:58 +00:00
Emilio Cobos Álvarez
09bb95c69f Bug 1618678 - Make scrollbar style caching work on Android. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D65915
2020-04-04 12:39:56 +00:00
Gurzau Raul
7488b7888f Backed out changeset 813e1405e501 (bug 40545) for Android failures at test_bug659596.html on a CLOSED TREE. 2020-04-01 19:35:32 +03:00
Chris H-C
b9fca9539f Bug 40545 - Options to use label attribute when present r=emilio,jfkthame,mats
According to spec, option elements with label attributes should show and use
those labels rather than their element text. So let's do that.

Requires some trickery because the option element is a block element (so it
lays out its width based on its text content) so we put its label (if it has
one) in its ::before and skip frame generation so it measures the text of its
label, not of its text node children.

Differential Revision: https://phabricator.services.mozilla.com/D63545
2020-04-01 09:20:21 +00:00
Emilio Cobos Álvarez
3479dd9ee8 Bug 1611848 - Properly suppress shadow dom / display: contents inside svg text. r=heycam
Returning null from FindSVGData just means "fall back to whatever display
specifies", and that's not great.

Differential Revision: https://phabricator.services.mozilla.com/D67706
2020-03-26 00:06:53 +00:00
Sean Feng
fbd3ec536a Bug 1377999 - Make TextNode to adapt the DOMArena changes r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D62353
2020-03-17 14:53:54 +00:00
Ting-Yu Lin
807ebe1c6c Bug 1622008 Part 3 - Remove nsPresContext* and PresShell* from the argument list of some continuing-frame-creation methods. r=dholbert
Both PresShell() and PresContext() are cached in nsIFrame. This
simplifies the setup for the callers to
nsCSSFrameConstructor::CreateContinuingFrame().

Differential Revision: https://phabricator.services.mozilla.com/D66600
2020-03-12 21:50:23 +00:00
Ting-Yu Lin
317d84813f Bug 1622008 Part 2 - Use cached mPresShell in nsCSSFrameConstructor. r=dholbert
The nsPresContext* argument of
nsCSSFrameConstructor::CreateContinuingFrame() is used only to get
PresShell. However, mPresShell is already cached in
nsCSSFrameConstructor (via its base class nsFrameManager).

By switching to use the cached value, we can remove now-unused
nsPresContext* or PresShell* from some continuing-frame-creation
methods' argument list in the next part.

Differential Revision: https://phabricator.services.mozilla.com/D66599
2020-03-12 21:50:21 +00:00
David Major
346f4e075f Bug 1620694 - Prevent inlining of nsFrameConstructorState::ProcessFrameInsertions r=dholbert
`nsFrameConstructorState::ProcessFrameInsertions` has a 600+ byte stack frame due to its `AutoTArray`s. If this function becomes indirectly inlined into the recursive parts of `nsCSSFrameConstructor`, that will bloat the callers' stack frames and make us pay 600 bytes at every level of recursion. Crashtests aren't happy about that on stack-limited Win32 builds.

This inlining has not yet happened in official builds, but did occur in my try runs for bug 1619461 where the inliner became more aggressive.

Differential Revision: https://phabricator.services.mozilla.com/D65815
2020-03-09 14:22:34 +00:00
Tim Nguyen
da0471ef5a Bug 1610597 - Re-introduce display: -moz-stack; as <legacy-stack>. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D62758
2020-02-14 16:32:38 +00:00
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