Commit Graph
500 Commits
Author SHA1 Message Date
Emilio Cobos Álvarez 411e7a33b1 Bug 2045394 - Fix nsFrameSetFrame primary frame handling of children. r=layout-reviewers,dshin
As always, frameset still sucks.

Differential Revision: https://phabricator.services.mozilla.com/D305125
2026-06-10 10:20:37 +00:00
Eugeniusz Lewandowski fc8097fcc3 Bug 1650944 - Remove ReflowInput.h include from nsIFrame.h r=firefox-style-system-reviewers,layout-reviewers,emilio
Removed the Reflow Input in nsIFrame. Added includes for ReflowInput as
necessary in cpp files. Also Forward Declared nsLineLayout in 3 header
files.

Differential Revision: https://phabricator.services.mozilla.com/D298203
2026-05-04 12:06:23 +00:00
serge-sans-paille f81328e365 Bug 2023519 - Make our codebase modernize-use-equals-default + modernize-use-equals-delete -safe wrt. clang-tidy r=sylvestre,necko-reviewers,media-playback-reviewers,profiler-reviewers,dom-storage-reviewers,layout-reviewers,dom-worker-reviewers,valentin,jesup,padenot,edenchuang,emilio
The changeset has been generated automatically through:

    ./mach static-analysis check --output ./clang-tidy-bugprone.json --format json --fix

followed by manual adjustment when needed or when the auto-fixer bailed out.

This paves the way for Bug 2023527

Differential Revision: https://phabricator.services.mozilla.com/D287941
2026-03-22 08:35:47 +00:00
Alexandru Marc 04e5f74151 Revert "Bug 2023519 - Make our codebase modernize-use-equals-default + modernize-use-equals-delete -safe wrt. clang-tidy r=sylvestre,necko-reviewers,media-playback-reviewers,profiler-reviewers,dom-storage-reviewers,layout-reviewers,dom-worker-reviewers,valentin,jesup,padenot,edenchuang,emilio"
This reverts commit a64dec2665.
2026-03-19 17:29:58 +00:00
serge-sans-paille a64dec2665 Bug 2023519 - Make our codebase modernize-use-equals-default + modernize-use-equals-delete -safe wrt. clang-tidy r=sylvestre,necko-reviewers,media-playback-reviewers,profiler-reviewers,dom-storage-reviewers,layout-reviewers,dom-worker-reviewers,valentin,jesup,padenot,edenchuang,emilio
The changeset has been generated automatically through:

    ./mach static-analysis check --output ./clang-tidy-bugprone.json --format json --fix

followed by manual adjustment when needed or when the auto-fixer bailed out.

This paves the way for Bug 2023527

Differential Revision: https://phabricator.services.mozilla.com/D287941
2026-03-18 17:25:01 +00:00
Sylvestre Ledru 55481ac4b5 Bug 2023419 - Remove Emacs/Vim modelines from layout/ r=emilio,firefox-style-system-reviewers,layout-reviewers
replaced by .editorconfig

Differential Revision: https://phabricator.services.mozilla.com/D287852
2026-03-17 12:05:43 +00:00
Emilio Cobos Álvarez f027136b53 Bug 2019341 - Fix frameset border handling. r=layout-reviewers,dshin,freddyb
This deals with ::backdrop's placeholder correctly.

In general, this frameset code looks like it could get a rewrite but...

Differential Revision: https://phabricator.services.mozilla.com/D285220
2026-03-05 19:48:57 +00:00
Emilio Cobos Álvarez 6af9d4cbfc Bug 2016506 - Deal with non-empty lists in nsHTMLFramesetFrame::SetInitialChildList. r=layout-reviewers,dshin
If you make a fullscreen <frameset>, it goes out of flow and now we
create a backdrop.

Framesets are super weird, they create child frames on Init()... They
are also supposed to not be out of flow, but fullscreen trumps that.

This keeps effectively the pre-regression state of affairs.

Differential Revision: https://phabricator.services.mozilla.com/D284401
2026-02-23 16:56:43 +00:00
Emilio Cobos Álvarez 30b7a3d89a Bug 2014922 - Untangle pseudo-element and anon box definitions. r=firefox-style-system-reviewers,xpcom-reviewers,layout-reviewers,dshin,nika
I looked at this because in bug 2014331 I need to mark more pseudos as
element-backed, and it's kinda silly the state our setup is in right
now.

This is all a somewhat historical mess, because in the old style system
pseudo-elements were just atoms, and we had that different types of atom
setup. The source of truth for these right now lives in a header macro
file, which isn't very flexible.

But now we have PseudoStyleType which represents both pseudos and anon
boxes, and is similar to the rust side PseudoElement enum.

Plus, the ::-moz-tree pseudo-elements are defined as anon boxes which
doesn't make any sense, so move them to pseudo-elements while at it.

Unify this in a similar way we treat CSS properties: Source of truth is
in pseudo_elements.toml / anon_boxes.toml, and we generate Rust and C++
as needed. This allows removing the nsStaticAtom subclass thing from
XPCOM, too.

This avoids some nasty duplication around which pseudos are pref-gated
and what not as well.

Differential Revision: https://phabricator.services.mozilla.com/D282076
2026-02-06 07:39:54 +00:00
Norisz Fay 27f4694604 Revert "Bug 2014922 - Untangle pseudo-element and anon box definitions. r=firefox-style-system-reviewers,xpcom-reviewers,layout-reviewers,dshin,nika" for causing bustage @ ElementAnimationData.h
This reverts commit c70290c619.
2026-02-06 05:34:42 +00:00
Emilio Cobos Álvarez c70290c619 Bug 2014922 - Untangle pseudo-element and anon box definitions. r=firefox-style-system-reviewers,xpcom-reviewers,layout-reviewers,dshin,nika
I looked at this because in bug 2014331 I need to mark more pseudos as
element-backed, and it's kinda silly the state our setup is in right
now.

This is all a somewhat historical mess, because in the old style system
pseudo-elements were just atoms, and we had that different types of atom
setup. The source of truth for these right now lives in a header macro
file, which isn't very flexible.

But now we have PseudoStyleType which represents both pseudos and anon
boxes, and is similar to the rust side PseudoElement enum.

Plus, the ::-moz-tree pseudo-elements are defined as anon boxes which
doesn't make any sense, so move them to pseudo-elements while at it.

Unify this in a similar way we treat CSS properties: Source of truth is
in pseudo_elements.toml / anon_boxes.toml, and we generate Rust and C++
as needed. This allows removing the nsStaticAtom subclass thing from
XPCOM, too.

This avoids some nasty duplication around which pseudos are pref-gated
and what not as well.

Differential Revision: https://phabricator.services.mozilla.com/D282076
2026-02-06 03:42:45 +00:00
serge-sans-paille c3b06ff4b4 Bug 1997165 - Remove unused mfbt inclusion in layout/** r=emilio,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,dshin,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D270577
2025-10-29 22:18:06 +00:00
serge-sans-paille 2680f1aa2a Bug 1995938 - Remove unused inclusion of DebugOnly.h r=emilio,necko-reviewers,application-update-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,toolkit-telemetry-reviewers,firefox-svg-reviewers,layout-reviewers,dom-worker-reviewers,bytesized,gstoll,mstange,TYLin,chunmin,jesup,asuth
Differential Revision: https://phabricator.services.mozilla.com/D269780
2025-10-27 10:48:42 +00:00
Cristian Tuns 6f66cdf3c7 Revert "Bug 1995938 - Remove unused inclusion of DebugOnly.h r=emilio,necko-reviewers,application-update-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,toolkit-telemetry-reviewers,firefox-svg-reviewers,layout-reviewers,dom-worker-reviewers,bytesized,gstoll,mstange,TYLin,chunmin,jesup,asuth" for causing build bustages in TargetFunction.h
This reverts commit 10e5184168.
2025-10-27 08:58:03 +00:00
serge-sans-paille 10e5184168 Bug 1995938 - Remove unused inclusion of DebugOnly.h r=emilio,necko-reviewers,application-update-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,toolkit-telemetry-reviewers,firefox-svg-reviewers,layout-reviewers,dom-worker-reviewers,bytesized,gstoll,mstange,TYLin,chunmin,jesup,asuth
Differential Revision: https://phabricator.services.mozilla.com/D269780
2025-10-27 08:00:43 +00:00
Andrew McCreight a454ba58bb Bug 1992886 - Use nsTArray for locals in nsHTMLFramesetFrame::Reflow(). r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D267691
2025-10-08 14:59:34 +00:00
Andrew McCreight de638bb57a Bug 1992422 - part 3: Eliminate mNumRows and mNumCols. r=layout-reviewers,emilio
Now that these two data members are set in exactly one place after
initialization, we can see that they always have the same value as the length
of mRowSizes and mColSizes, so remove the members. Hopefully the extra overhead
from the integer conversions isn't relevant.

Differential Revision: https://phabricator.services.mozilla.com/D267674
2025-10-07 23:53:49 +00:00
Andrew McCreight 4124fd8029 Bug 1992422 - part 2: Convert GetRowSpec and GetColSpec to Span. r=layout-reviewers,emilio
Nobody ever checks the failure value, so return the Span directly.

This drops the setting of mNumRows and mNumCols in MouseDrag(), because we
already require that the number of rows or columns does not change. This is
checked via an assertion in GenerateRowCol().

Differential Revision: https://phabricator.services.mozilla.com/D267673
2025-10-07 23:53:46 +00:00
Andrew McCreight ebee4e40b1 Bug 1992422 - part 1: Use getters to access mNumRows and mNumCols. r=layout-reviewers,emilio
A later patch will remove these data members, so do this change
separately to clean things up a bit.

Also, clean up a few for loop variables.

Differential Revision: https://phabricator.services.mozilla.com/D267672
2025-10-07 23:53:42 +00:00
Andrew McCreight 1226c043cc Bug 1880093 - part 8: Remove aNumItems argument from nsHTMLFramesetFrame::Scale(). r=layout-reviewers,emilio
The calculate and generate methods rely on the aValues and aSpecs arrays having
the same number of elements, so document that with an assertion.

Differential Revision: https://phabricator.services.mozilla.com/D267419
2025-10-03 19:41:20 +00:00
Andrew McCreight 39f53db991 Bug 1880093 - part 7: Use nsTArray for local vars in nsHTMLFramesetFrame::CalculateRowCol. r=layout-reviewers,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D267086
2025-10-03 19:41:16 +00:00
Andrew McCreight 225aa81b02 Bug 1880093 - part 6: Use nsTArray for nsFrameSetFrame::mChildFrameborder and mChildBorderColors. r=layout-reviewers,emilio
This is a little weird because we need to track whether the reflow processing has been
done already.

Differential Revision: https://phabricator.services.mozilla.com/D267085
2025-10-03 19:41:12 +00:00
Andrew McCreight 8217236ccc Bug 1880093 - part 5: Use nsTArray for nsFrameSetFrame::mVerBorders and ::mHorBorders. r=layout-reviewers,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D267084
2025-10-03 19:41:09 +00:00
Andrew McCreight 5c04a93950 Bug 1880093 - part 4: Use nsTArray for nsFrameSetFrame::mRowSizes and ::mColSizes. r=layout-reviewers,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D267083
2025-10-03 19:41:05 +00:00
Andrew McCreight 68fc7de605 Bug 1880093 - part 1: Limit scope of some indices in nsHTMLFramesetFrame. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D267325
2025-10-03 19:40:53 +00:00
Emilio Cobos Álvarez a8a2311474 Bug 1976457 - Sort includes in layout/. r=janv,dshin
Interesting bit is layout/.clang-format, the rest is all automated.

Differential Revision: https://phabricator.services.mozilla.com/D256616
2025-07-09 13:24:00 +00:00
Timothy Nikkel 08ddfd3c5c Bug 1933521. Fix hit testing of backface-visibility: hidden frames that are not transformed. r=layout-reviewers,emilio
preserve3d means that transforms on child frames are in a shared 3d transform space with their parent; rather than transforming the child in it's own 3d space and then rendering the 2d depiction of that and then the parent applies it's own transform to the flat representation of the child frame. And this can be extended down the DOM tree: each direct descendant with preserve3d then participates in the same shared 3d space. The tree of all frames that are all in one shared preserve3d space form a preserve3d context.

Setting preserve3d on a frame makes the frame considered to be transformed (whether it has an actual transform or not).

combines3d means that the parent frame is preserve3d AND this frame is either transformed or is backface-visibility: hidden.

A leaf in the preserve3d context is a frame that is combines3D but is not preserve3d itself. So it is the last frame in the preserve3d context. In other words, it's a frame that is not preserve3d but its parent is preserve3d, AND it's either transformed or backface-visibility: hidden.

To make this work in the display list, items get wrapped in transform items. Specifically, after we've built the display list for a preserve3d frame (preserve3d makes the frame transformed, so it's a stacking context) we determine if every item is a participant in that preserve3d context or a non-participant. A participant is a transform or perspective item for a frame that is in the same preserve3d context. A non-participant is anything else. Non-participants get wrapped in a new transform item whose frame is the current preserve3d frame and the transform item gets tagged as a transform seperator.

We defined preserve3d leaf frame above (the last frame that is in the preserve3d context). We define a preserve3d leaf transform display item as one where the frame is a preserve3d leaf, or the item is tagged as a transform seperator (note the small difference). This makes sense since the display item contained in the transform seperator item is not part of the preserve3d context.

Thus for every preserve3d context there is a set of leaf transform display items that contain all of the content to draw. Every other item in the context that is above these leaf transform items is a transform item of a frame in the preserve3d context that is not a leaf transform item. And below these leaf transform items is the display items for the content to draw. We don't need to worry about these non-leaf transform items because whenever we get the transform for a leaf transform item we accumulate the whole transform from the root of the preserve3d context down to the leaf item.

Hit testing is done by first finding this set of leaf transform items and then iterating over them in the usual way.

However there is a subtle issue with this: backface-visibility: hidden frames are combines3d (and thus part of the preserve3d context) but are not transformed, so they don't generate transform items. So when doing the wrapping process from above they are considered to be non-participants and they get wrapped with a transform seperator item, and that transform seperator item is what is considered the leaf. This setup works fine for most things but it does not work fine when hittesting the backface-visibility: hidden leaf. Because the backface-visibility: hidden check happens in the transform item hittest function, and there is no transform item for the backface-visibility: hidden frame. The transform item knows that the transform is showing the backface, but it's frame is not backface-visibility: hidden. And the item for the backface-visibility: hidden frame is not a transform item, so it doesn't know the current transform.

To fix this we put a little state in the hit testing state that tracks if the transform shows the backface. We reset this bit whenever we actually exit the preserve3d context (by checking if the item is no longer combines3d). And then when hittesting the item, the item can combine that state with its local backface-visibility to determine if it is hit or not.

Differential Revision: https://phabricator.services.mozilla.com/D252978
2025-06-12 10:21:07 +00:00
Timothy Nikkel 292af322c3 Bug 1933440. Make all display item destructors default and mark all display items final that can be. r=layout-reviewers,jfkthame
This just makes things nice and consistent and lets the compiler optimize if it can.

Differential Revision: https://phabricator.services.mozilla.com/D230249
2024-12-06 13:22:11 +00:00
Jonathan Watt 7532be254f Bug 1931736. Add missing braces around if/loop statements in layout/generic/. r=layout-reviewers,emilio
Depends on D229247

Differential Revision: https://phabricator.services.mozilla.com/D229248
2024-11-17 05:03:58 +00:00
Ting-Yu Lin 8087c0ed21 Bug 1906792 Part 2 - More cleanup for nsLeafFrame. r=layout-reviewers,emilio
- Expand `SizeToAvailSize()` at callsites since it is only used twice, and the
  callsites already have called `SetOverflowAreasToDesiredBounds()`.
- Revise obsolete comment for `nsLeafFrame`.
- Remove redundant `virtual` keyword.

Differential Revision: https://phabricator.services.mozilla.com/D215999
2024-07-09 18:49:32 +00:00
Ting-Yu Lin 4ef20f0ad7 Bug 1906792 Part 1 - Let nsLeafFrame and subclasses override GetIntrinsicSize(). r=layout-reviewers,emilio
`nsIFrame` already provides `GetIntrinsicSize()` for subclasses to override.
Therefore, `nsLeafFrame` doesn't need to introduce another version for its
subclasses.

This patch (hopefully) shouldn't change the behavior.

Differential Revision: https://phabricator.services.mozilla.com/D215998
2024-07-09 18:49:32 +00:00
Ting-Yu Lin 8a77ebbb16 Bug 1888535 Part 5 - Remove DISPLAY_REFLOW. r=layout-reviewers,emilio
It is used in `Reflow()` implementations.

Differential Revision: https://phabricator.services.mozilla.com/D206317
2024-04-02 19:03:05 +00:00
Edgar Chen 7c3453d032 Bug 1878976 - Remove plugin-related code in EventStateManager; r=emilio
`nsIFrame::GetCursor()` can never return `Nothing()` after bug 1687239, which
removes `nsPluginFrame`. Therefore `mLastFrameConsumedSetCursor` in
`EventStateManager` can never be true.

Differential Revision: https://phabricator.services.mozilla.com/D200890
2024-02-07 12:35:27 +00:00
Emilio Cobos Álvarez 529c9ee321 Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
Ting-Yu Lin ef6d896662 Bug 1799732 Part 3 - Convert FrameChildListID to enum class. r=emilio
This patch is first generated by the following script under gecko root folder.

```
#!/bin/bash

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "kPrincipalList" "FrameChildListID::Principal"
rename "kPopupList" "FrameChildListID::Popup"
rename "kCaptionList" "FrameChildListID::Caption"
rename "kColGroupList" "FrameChildListID::ColGroup"
rename "kAbsoluteList" "FrameChildListID::Absolute"
rename "kFixedList" "FrameChildListID::Fixed"
rename "kOverflowList" "FrameChildListID::Overflow"
rename "kOverflowContainersList" "FrameChildListID::OverflowContainers"
rename "kExcessOverflowContainersList" "FrameChildListID::ExcessOverflowContainers"
rename "kOverflowOutOfFlowList" "FrameChildListID::OverflowOutOfFlow"
rename "kFloatList" "FrameChildListID::Float"
rename "kBulletList" "FrameChildListID::Bullet"
rename "kPushedFloatsList" "FrameChildListID::PushedFloats"
rename "kBackdropList" "FrameChildListID::Backdrop"
rename "kNoReflowPrincipalList" "FrameChildListID::NoReflowPrincipal"
```

And then:
1. Manually fix `FrameChildListID` definition in nsFrameList.h.
2. Apply clang-format.

Differential Revision: https://phabricator.services.mozilla.com/D161864
2022-11-12 04:38:53 +00:00
Noemi Erli a66dba1527 Backed out 3 changesets (bug 1799732) for causing build bustages in nsIFrame.cpp CLOSED TREE
Backed out changeset e559f9dbc76f (bug 1799732)
Backed out changeset c40fda7a8b0b (bug 1799732)
Backed out changeset 1f84bfb41ab8 (bug 1799732)
2022-11-12 02:16:45 +02:00
Ting-Yu Lin 60a57a352d Bug 1799732 Part 3 - Convert FrameChildListID to enum class. r=emilio
This patch is first generated by the following script under gecko root folder.

```
#!/bin/bash

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "kPrincipalList" "FrameChildListID::Principal"
rename "kPopupList" "FrameChildListID::Popup"
rename "kCaptionList" "FrameChildListID::Caption"
rename "kColGroupList" "FrameChildListID::ColGroup"
rename "kAbsoluteList" "FrameChildListID::Absolute"
rename "kFixedList" "FrameChildListID::Fixed"
rename "kOverflowList" "FrameChildListID::Overflow"
rename "kOverflowContainersList" "FrameChildListID::OverflowContainers"
rename "kExcessOverflowContainersList" "FrameChildListID::ExcessOverflowContainers"
rename "kOverflowOutOfFlowList" "FrameChildListID::OverflowOutOfFlow"
rename "kFloatList" "FrameChildListID::Float"
rename "kBulletList" "FrameChildListID::Bullet"
rename "kPushedFloatsList" "FrameChildListID::PushedFloats"
rename "kBackdropList" "FrameChildListID::Backdrop"
rename "kNoReflowPrincipalList" "FrameChildListID::NoReflowPrincipal"
```

And then:
1. Manually fix `FrameChildListID` definition in nsFrameList.h.
2. Apply clang-format.

Differential Revision: https://phabricator.services.mozilla.com/D161864
2022-11-11 23:44:17 +00:00
Ting-Yu Lin 782d64e3cf Bug 1798373 Part 5 - Change nsContainerFrame::SetInitialChildList() to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160841
2022-11-01 21:15:54 +00:00
Ben Freist 5b31768c71 Bug 1793483 - [refactor] Migrate NS_STYLE_FRAME_* defines r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D158526
2022-10-26 18:51:45 +00:00
Norisz Fay 96eb28ddf0 Backed out changeset 8afa6eaecd2f (bug 1793483) for causing mochitest failures on test_Prototype.html and test_HTMLFrameElement01.html CLOSED TREE 2022-10-14 22:50:10 +03:00
Ben Freist 6d7141da37 Bug 1793483 - [refactor] Migrate NS_STYLE_FRAME_* defines r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D158526
2022-10-14 16:03:35 +00:00
Ting-Yu Lin 06ddbd2b65 Bug 1464761 Part 4 - Remove nsReflowStatus::mTruncated bit. r=dholbert
In the description of the mTruncated bit, its purpose is the same as calling
SetInlineLineBreakBeforeAndReset(). We've removed all its usages in previous
patches, so the bit is no longer needed.

Differential Revision: https://phabricator.services.mozilla.com/D151461
2022-07-27 21:55:18 +00:00
Emilio Cobos Álvarez c5be0433f1 Bug 1738614 - Remove other Widget* colors. r=mstange
These are only used for frameset painting and the non-e10s <select>
dropdown focus codepath. We have other more appropriate standard
colors for this.

Differential Revision: https://phabricator.services.mozilla.com/D129992
2021-11-02 18:08:07 +00:00
Matt Woodrow 4883cc6406 Bug 1728709 - Add nsDisplayItem::GetPaintRect that computes a value using the current clip extents. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D124299
2021-09-03 18:58:18 +00:00
Emilio Cobos Álvarez bc6ae36fa1 Bug 1702676 - Change public LookAndFeel API to accept a color scheme. r=mstange
This shouldn't change behavior, but is the biggest cross-platform part
of the change so I'd like to get it landed sooner rather than later.

The two calls like:

  GetColor(ColorID::TextSelectBackground, color);
  if (color == 0x000000) {
    mColorTextSelectForeground = NS_RGB(0xff, 0xff, 0xff);
  } else {
    mColorTextSelectForeground = NS_DONT_CHANGE_COLOR;
  }

that I'm removing are just broken. They were calling the version of
GetColor the function that took a default value when the color wasn't
available, not the version of the color with the outparam.

To prevent such mistakes, add two signatures, GetColor(), returning a
Maybe<nscolor> and Color(), returning a color with a fallback.

Differential Revision: https://phabricator.services.mozilla.com/D110651
2021-04-02 12:22:14 +00:00
Narcis Beleuzu a930cd6068 Backed out changeset 597b9606c3ca (bug 1702676) for reftest failures on mq_prefers_reduced_motion_reduce.html CLOSED TREE 2021-04-02 09:34:53 +03:00
Emilio Cobos Álvarez 17fdb9a048 Bug 1702676 - Change public LookAndFeel API to accept a color scheme. r=mstange
This shouldn't change behavior, but is the biggest cross-platform part
of the change so I'd like to get it landed sooner rather than later.

The two calls like:

  GetColor(ColorID::TextSelectBackground, color);
  if (color == 0x000000) {
    mColorTextSelectForeground = NS_RGB(0xff, 0xff, 0xff);
  } else {
    mColorTextSelectForeground = NS_DONT_CHANGE_COLOR;
  }

that I'm removing are just broken. They were calling the version of
GetColor the function that took a default value when the color wasn't
available, not the version of the color with the outparam.

To prevent such mistakes, add two signatures, GetColor(), returning a
Maybe<nscolor> and Color(), returning a color with a fallback.

Differential Revision: https://phabricator.services.mozilla.com/D110651
2021-04-02 00:21:37 +00:00
Emilio Cobos Álvarez d791b7bfc8 Bug 1691858 - Minor cleanup of our @page rule setup. r=AlaskanEmily
Actually, there's not so much we can improve right now, in the sense
that:

 * We need the ::-moz-page-content pseudo-element to be able to set
 `display` on the page, since that's a style rule rather than a @page
 rule. We could get away without it.

 * Keeping the current code-path (slightly cleaned up) is less code, for
 now at least. We can have a separate code-path or what not that
 actually performs the @page rule selector-matching and what not if
 needed when we get to named pages or other page selectors. Selectors
 like :first should be pretty trivial to implement, actually.

We make some paged mode anon boxes non-inheriting anon boxes. This
allows us to share the styles and is generally nicer. They don't need to
inherit from anywhere.

We could remove the origin handling and don't look at UA rules or what
not, but it seems pretty harmless to do that.

We also fix the name of the pseudo-elements to match the capitalization.

Differential Revision: https://phabricator.services.mozilla.com/D104772
2021-02-12 15:42:38 +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 413c249077 Bug 1643464 - Part 1: Rename eLeft/eRight to ePrimary/eSecondary r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D80331
2020-06-19 18:02:41 +00:00