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

262 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 30f7439a31 Bug 1682882 - Don't crash when trying to figure out the parent style of a node about to be reframed. r=heycam
This is basically the situation described here:

  https://searchfox.org/mozilla-central/rev/8d722de75886d6bffc116772a1db8854e34ee6a7/layout/generic/nsIFrame.cpp#9961-9964

Differential Revision: https://phabricator.services.mozilla.com/D100097
2020-12-23 03:01:19 +00:00
Ting-Yu Lin b5d7c879c0 Bug 1673056 - Remove nsLayoutUtils::MIN_ISIZE and nsLayoutUtils::PREF_ISIZE. r=mats
Both are aliases to IntrinsicISizeType::MinISize and
IntrinsicISizeType::PrefISize.

Remove MOZ_ASSERT in nsLayoutUtils::IntrinsicForAxis and
nsContainerFrame::DoInlineIntrinsicISize since IntrinsicISizeType is a
enum class nowadays, which cannot have other values.

I've compiled this patch with DEBUG_INTRINSIC_WIDTH defined in
nsLayoutUtils.cpp, and fixed aWM undefined in
nsLayoutUtils::MinSizeContributionForAxis().

Differential Revision: https://phabricator.services.mozilla.com/D94618
2020-10-23 22:52:02 +00:00
Kagami Sascha Rosylight 1afcf4d621 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 cd8b8939b9 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 b601151ba7 Bug 1647525 - Use HasAnyStateBits() in nsPlaceholderFrame r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81206
2020-06-27 13:17:21 +00:00
Ting-Yu Lin 5610a9711b Bug 1627398 Part 1 - Convert nsIFrame::List flags to EnumSet. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D69914

--HG--
extra : moz-landing-system : lando
2020-04-08 00:22:19 +00:00
Andrew Osmond 91b071ed14 Bug 1618345 - Enforce proper color management by splitting gfx::Color into sRGBColor and DeviceColor types. r=jrmuizel
gfx::Color is currently misused in many places. The DrawTargets expect
the color space to be in device space, e.g. what we are actually going
to draw using. Everything sitting above generally deals with sRGB, as
specified in CSS. Sometimes we missed the conversion from sRGB to device
space when issuing draw calls, and similarly sometimes we converted the
color to device space twice.

This patch splits the type in two. sRGBColor and DeviceColor now
represent sRGB and device color spaces respectively. DrawTarget only
accepts DeviceColor, and one can get a DeviceColor from an sRGBColor via
the ToDeviceColor helper API. The reftests now pass with color
management enabled for everything (e.g. CSS) instead of just tagged
raster images.

There will be a follow up patch to enable color management everywhere by
default on all supported platforms.

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

--HG--
extra : moz-landing-system : lando
2020-03-09 14:16:17 +00:00
Emilio Cobos Álvarez c5c0ef9787 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

--HG--
extra : moz-landing-system : lando
2020-02-06 16:06:49 +00:00
Daniel Holbert ae192ec3a5 Bug 1613192: Fix non-unified build bustage in layout/{base,generic} directories. r=TYLin
Summary of the changes/reasons:

- LayoutTelemetryTools.h directly uses several types whose headers it needs to
  include. (These includes were present in its .cpp file; I'm migrating them
  from there to the .h file, and I'm adding a new include for "Saturate.h" to
  provide the SaturateUint8 type.)

- LayoutTelemetryTools.cpp needs an include for MainThreadUtils.h, to provide
  NS_IsMainThread().

- StaticPresData.cpp needs an include for ServoUtils.h, to provide
  AssertIsMainThreadOrServoFontMetricsLocked().

- ZoomConstraintsClient.h needs a forward-decl for mozilla::dom::Document since
  it uses a pointer of that type in a function-decl.

- ScrollSnap.h needs forward-decls of nsPoint/nsRect for some references to
  those types in a method signature.

- nsGridContainerFrame.cpp needs an include for nsBoxLayoutState.h since it
  uses that type (it instantiates a nsBoxLayoutState instance).

- nsPlaceholderFrame.cpp needs a "using" decl for the mozilla::dom namespace in
  order to use the un-namespace-prefixed "Element" type.

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

--HG--
extra : moz-landing-system : lando
2020-02-04 19:34:51 +00:00
Ting-Yu Lin 73021bb855 Bug 1598132 - Add GetPrevContinuationOrIBSplitSibling() and improve GetNextContinuationOrIBSplitSibling() in nsLayoutUtils. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D54037

--HG--
extra : moz-landing-system : lando
2019-11-20 22:31:31 +00:00
Cameron McCormack 5bf528676e Bug 1554571 - Part 1: Remove unused argument from Servo_ResolveStyle. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D33121

--HG--
extra : moz-landing-system : lando
2019-06-27 07:22:13 +00:00
Mihai Alexandru Michis b485399185 Backed out 4 changesets (bug 1554571) for causing failures in minimal-xul.css
Backed out changeset 1cc4e6374b8a (bug 1554571)
Backed out changeset 30728685499e (bug 1554571)
Backed out changeset c14e9c381345 (bug 1554571)
Backed out changeset a2143551d7bc (bug 1554571)

--HG--
extra : rebase_source : 4b4442d96eb40e57b0a9834b4048b11f9be1a964
2019-06-27 07:09:55 +03:00
Cameron McCormack 60ac348ac5 Bug 1554571 - Part 1: Remove unused argument from Servo_ResolveStyle. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D33121

--HG--
extra : moz-landing-system : lando
2019-06-27 00:24:54 +00:00
Ting-Yu Lin 3a4933eb98 Bug 1549267 Part 1 - Remove NS_INTRINSICSIZE and NS_AUTOHEIGHT. r=mats
This patch is generated by the following steps.

1) Manually delete NS_INTRINSICSIZE and NS_AUTOHEIGHT in LayoutConstants.

2) Run the following script.
```
  #!/bin/bash
  function rename() {
      find .\
           -type f\
           ! -path "./obj*"\
           ! -path "./.git"\
           ! -path "./.hg"\
           \( -name "*.cpp" -or\
              -name "*.h" \)\
              -exec sed -i -e "s/$1/$2/g" "{}" \;
  }

  rename NS_INTRINSICSIZE NS_UNCONSTRAINEDSIZE
  rename NS_AUTOHEIGHT NS_UNCONSTRAINEDSIZE
```

3) ./mach clang-format

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

--HG--
extra : moz-landing-system : lando
2019-06-04 23:41:20 +00:00
Masayuki Nakano 36e5df54ec Bug 1547621 - Move all inline methods of nsIPresShell into mozilla::PresShell r=smaug
And also this patch moves some related methods which use the inline methods
and member variables used only by them.

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

--HG--
rename : layout/base/nsIPresShellInlines.h => layout/base/PresShellInlines.h
extra : moz-landing-system : lando
2019-04-30 01:52:53 +00:00
Masayuki Nakano 2f9688c14e Bug 1544343 - part 2: Make factory methods take mozilla::PresShell instead of nsIPresShell r=emilio
Additionally, this patch makes `nsFrame.h` stop including `nsIPresShell.h`
and makes each users include `mozilla/PresShell.h` instead.  So, this improves
rebuild performance of `nsIPresShell.h` (and `mozilla/PresShell.h` in the
future).

Note that due to `nsIFrame::PresShell()`, `mozilla::` prefix is necessary for
`PresShell` in a lot of classes which are derived from `nsIFrame` even in
`.cpp` files.

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

--HG--
extra : moz-landing-system : lando
2019-04-16 07:24:49 +00:00
Masayuki Nakano e8446480e1 Bug 1542407 - Make nsIFrame use mozilla::PresShell directly rather than via nsIPresShell r=emilio
Except retrieving from weak reference, `nsIFrame` should treat
`mozilla::PresShell` directly rather than via `nsIPresShell`.

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

--HG--
extra : moz-landing-system : lando
2019-04-06 06:02:28 +00:00
Masayuki Nakano 5e41233499 Bug 1540990 - Get rid of unnecessary nsIPresShell.h inclusions r=emilio
A lot of files include `nsIPresShell.h` even though currently they don't
need it.  This patch removes the unnecessary inclusions.

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

--HG--
extra : moz-landing-system : lando
2019-04-04 00:19:48 +00:00
Matt Woodrow d99a15fae2 Bug 1539673 - Support fallible display item construction. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D25167

--HG--
extra : moz-landing-system : lando
2019-04-01 16:53:11 +00:00
Ryan Hunt b936c00a65 Bug 1523969 part 14 - Move method definition inline comments to new line in 'layout/'. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D21115

--HG--
extra : rebase_source : 4d65c07d8822f3a54ac881b5d0f55468ce884554
2019-02-25 16:09:24 -06:00
Emilio Cobos Álvarez dad3a20b22 Bug 1525955 - Include anon boxes in CSSPseudoElementType, to remove ComputedStyle::mPseudoTag. r=heycam
This is more consistent with what the Rust bits of the style system do, and
removes a pointer from ComputedStyle which is always nice.

This also aligns the Rust bits with the C++ bits re. not treating xul pseudos as
anonymous boxes. See the comment in nsTreeStyleCache.cpp regarding those.

Can't wait for XUL trees to die.

Depends on D19001

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

--HG--
extra : moz-landing-system : lando
2019-02-19 13:44:33 +00:00
Emilio Cobos Álvarez 12867b1a3f Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D18734
2019-02-07 11:15:36 +01:00
Ting-Yu Lin c4c0690aa3 Bug 1523061 Part 1 - Remove two nsIFrame::ListTag() methods that retrieve frame tag in a string. r=dholbert
There are three different APIs that serve similar purpose. Keeping only
one is sufficient.

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

--HG--
extra : moz-landing-system : lando
2019-01-29 17:59:53 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Cameron McCormack 1db3f9da78 Bug 1512716 - Re-indent NS_QUERYFRAME macros after clang-format. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D13995

--HG--
extra : moz-landing-system : lando
2018-12-07 20:00:18 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Ting-Yu Lin a27733741a Bug 1489015 - Make NS_NewPlaceholderFrame() return nsPlaceholderFrame* to avoid type casting r=bzbarsky
Depends on D5112

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

--HG--
extra : moz-landing-system : lando
2018-09-14 17:14:53 +00:00
Emilio Cobos Álvarez 26b508d03c Bug 1478069: Trivial frame constructor cleanup. r=TYLin
Using references helps to see when stuff can and cannot be null.

I removed useless aTag / aNamespaceId arguments which are useless now that XBL
can't override them (bug 1450617), so FindXULData is the only one that keeps
them alive.

Also, I took the liberty of renaming a few fooComputedStyle variables to just
fooStyle, and clarify naming in some pseudo-element-related functions to say
originating element (the spec term) and avoid confusing it with the generated
_moz_generated_content_before / _moz_generated_content_after element.

Note that this is a partial state, more stuff will come in the future.

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

MozReview-Commit-ID: 39B30doREUH
2018-07-25 11:31:18 +02:00
Chris Peterson 71422dcaa9 Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj
s/NS_PRECONDITION/MOZ_ASSERT/ and reindent

MozReview-Commit-ID: KuUsnVe2h8L

--HG--
extra : source : c14655ab3df2c9b1465dd8102b9d25683359a37b
2018-04-28 12:50:58 -07:00
Emilio Cobos Álvarez c0f2f96f66 Bug 1303605: Remove the undisplayed maps. r=bz,mats
This is mostly code removal, changing GetDisplayContentsStyle(..) checks by an
FFI call to Servo.

The tricky parts are:

 * MaybeCreateLazily, which I fixed to avoid setting bits under display: none
   stuff. This was a pre-existing problem, which was wallpapered by the
   sc->IsInDisplayNoneSubtree() check, which effectively made the whole
   assertion useless (see bug 1381017 for the only crashtest that hit this
   though).

 * ContentRemoved, where we can no longer know for sure whether the element is
   actually display: contents if we're removing it as a response to a style
   change. See the comment there. That kinda sucks, but that case is relatively
   weird, and it's better than adding tons of complexity to handle that.

 * GetParentComputedStyle, which also has a comment there. Also, this function
   has only one caller now, so we should maybe try to remove it.

The different assertions after DestroyFramesForAndRestyle are changed for a
single assertion in the function itself, and the node bit used as an
optimization to avoid hashtable lookups is taken back.

MozReview-Commit-ID: AZm822QnhF9
2018-04-07 15:21:56 +02:00
Emilio Cobos Álvarez e341b20ec4 Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt on a CLOSED TREE
MozReview-Commit-ID: JPopq0LudD
2018-03-22 20:06:24 +01:00
Emilio Cobos Álvarez 5dd797f154 Back out changeset b683bb3f22a1 (Bug 1447483) for not landing with all the files. r=me on a CLOSED TREE
This reverts commit 1808914126bb9f9e4a82d2c3d7ac961885fe7d62.

MozReview-Commit-ID: 5skESBseEvo
2018-03-22 20:05:22 +01:00
Emilio Cobos Álvarez ca5ac79cca Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt
MozReview-Commit-ID: JPopq0LudD
2018-03-22 19:48:42 +01:00
Emilio Cobos Álvarez c976615ed6 Bug 1024082: Remove PresShell::FrameManager(), use PresShell::FrameConstructor instead. r=dholbert
Unfortunately this means that we need to export a couple more headers, but that
should be ok.

In particular, we have to export some headers that are #included by
nsCSSFrameConstructor.h, because nsCSSFrameConstructor.h itself will now be
included in more places outside of layout/, by .cpp files that don't necessarily
have the ability to indirectly #include its other headers, unless we export
them.

MozReview-Commit-ID: 2n9KHW6Yjrd
2018-03-07 10:17:52 +01:00
Matt Woodrow 4183152e2d Bug 1436904 - Part 1: Add a static constructor function for display items. r=Bas 2018-02-13 13:43:28 +13:00
Dorel Luca bd05e3853c Backed out 3 changesets (bug 1436904) for many crashes see bugs: 1440281, 1440302, 1440303, 1440313. a=backout
Backed out changeset 27f0762d4472 (bug 1436904)
Backed out changeset 27640f52e188 (bug 1436904)
Backed out changeset 2b4d117c27dc (bug 1436904)
2018-02-22 17:28:59 +02:00
Matt Woodrow e485bba27f Bug 1436904 - Part 1: Add a static constructor function for display items. r=Bas 2018-02-13 13:43:28 +13:00
Miko Mynttinen 2fc0722497 Bug 1425078 - Remove nsDisplayList::AppendNewToTop and nsDisplayList::AppendNewToBottom r=mattwoodrow
MozReview-Commit-ID: E3neKT2sV4Q

--HG--
extra : rebase_source : 98b65e4c82f8a965df211e828bc68d46e7a6716e
2017-12-13 11:23:04 -06:00
Mats Palmgren 25cd0c37f7 Bug 1400618 part 1 - Collect NAC / generated content and call DestroyAnonymousContent / UnbindFromTree on those after the frames are destroyed. r=bz
MozReview-Commit-ID: 2trDgeJPw25
2017-11-07 01:20:33 +01:00
Daniel Holbert 680815cd6e Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame
This patch was generated automatically by the "modeline.py" script, available
here: https://github.com/amccreight/moz-source-tools/blob/master/modeline.py

For every file that is modified in this patch, the changes are as follows:
 (1) The patch changes the file to use the exact C++ mode lines from the
     Mozilla coding style guide, available here:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line

 (2) The patch deletes any blank lines between the mode line & the MPL
     boilerplate comment.

 (3) If the file previously had the mode lines and MPL boilerplate in a
     single contiguous C++ comment, then the patch splits them into
     separate C++ comments, to match the boilerplate in the coding style.

MozReview-Commit-ID: EuRsDue63tK

--HG--
extra : rebase_source : 3356d4b80ff6213935192e87cdbc9103fec6084c
2017-10-27 10:33:53 -07:00
Emilio Cobos Álvarez d46ace29b9 Bug 1405605: Bypass the IsReallyFixedPos assertion when the style may have changed due to first-line reparenting. r=bz
MozReview-Commit-ID: HS0670UMqKK
2017-10-04 17:53:13 +02:00
Emilio Cobos Álvarez 660ab8f549 Bug 1404324: Use the placeholder state to remove out-of-flows that aren't real descendants of the destruction root. r=bz
Using the style of the frame can mess things up when we reparent them due to
::first-line before removing them.

MozReview-Commit-ID: 3Dt0wF2XRAH
2017-10-04 10:49:41 +02:00
Sebastian Hengst 0ba56b9c7d Backed out changeset cb247c8a0fe5 (bug 1404324) for landing with wrong commit message. r=backout 2017-10-04 10:48:14 +02:00
Emilio Cobos Álvarez ae652b0b37 Bug 1404324: Always remove out of flows from the placeholder frame, using its info. r=bz
MozReview-Commit-ID: 3Dt0wF2XRAH
2017-10-04 10:38:34 +02:00
Ting-Yu Lin 2e869d8f3d Bug 1341009 - Add nsReflowStatus::IsEmpty() assertions to all nsIFrame::Reflow() methods and some reflow helpers, and remove unneeded Reset(). r=dholbert
nsReflowStatus::IsEmpty() assertions are added after DISPLAY_REFLOW in the
beginning of the Reflow().

A few Reflow() implementations have Reset() calls at the end which are left
in place by this patch (with an explanatory comment added to each). These
ending Reset()s are only needed for cases where a non-splittable frame
passes its own nsReflowStatus to a child's reflow method. Just in case the
child leaves a "not fully complete" value in the nsReflowStatus, the
non-splittable parent frame must clear out the nsReflowStatus before
returning, so that its own parent doesn't then try to split it.

MozReview-Commit-ID: 6Jj3jfMAqj4

--HG--
extra : rebase_source : e1fe6a775ad97e16a6d7cc224634ff962ccb0fbf
2017-09-13 18:00:25 +08:00
Boris Zbarsky 9d11ba2233 Bug 1395979. Remove backdrop hackery from placeholder's GetLayoutParentStyleForOutOfFlow. r=xidorn
This was never even meant to apply to the out-of-flow, just to the placeholder
itself.  So it's been effectively dead since placeholders stopped inheriting
from another style context.
2017-09-01 20:57:55 -04:00
Boris Zbarsky 11a90dfbd9 Bug 1395591. When looking for our layout parent style, make sure to start with the placeholder if we're out of flow. r=emilio
MozReview-Commit-ID: 1M52bi3oQFX
2017-08-31 22:46:35 -04:00
Matt Woodrow 781ec6ffa1 Bug 1388162 - Add a Destroy function to nsDisplayItem to use instead of manually invoking the destructor, this will allow us to recycle them in the future. r=mstange
* * *
[mq]: fix

MozReview-Commit-ID: LUXZAIL73BJ
2017-08-07 16:07:43 +12:00
Matt Woodrow 40f5b92e3b Bug 1388161 - Store the dirty rect on the display list builder rather than passing it as a parameter to BuildDisplayList. r=mstange 2017-08-07 14:23:35 +12:00
Sebastian Hengst 8257b2d113 Backed out changeset 8f2dd8f13b53 (bug 1388161) for failing chrome's test_animation_performance_warning.html | preserve-3d transform. r=backout 2017-08-10 14:40:21 +02:00