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

66 Коммитов

Автор SHA1 Сообщение Дата
David Shin f5a42005e2 Bug 1811311 - Part 3: Refactor `GetNaturalBaselineBOffset` to return `Maybe<nscoord>`. r=layout-reviewers,emilio
Changed from returning `bool` & taking an out parameter.

Differential Revision: https://phabricator.services.mozilla.com/D168998
2023-02-23 14:53:27 +00:00
David Shin 5c7c22165f Bug 1811311 - Part 1: Unite baseline-related functions in `nsIFrame` into one. r=emilio
Before, there existed 3 virtual functions that calculated baselines:

- `GetLogicalBaseline`
- `GetVerticalAlignBaseline`
- `GetNaturalBaselineBOffset`

Each of them had slightly different behaviours:

- `GetLogicalBaseline` would synthesize a baseline if there is no baseline.
  Others would simply return `false`.
- `GetNaturalBaselineBOffset` requires the caller to pick which of first/last
  baseline to calculate. Others pick on on their own.
- `GetNaturalBaselineBOffset`'s result can be either offset from border box
   start/end edge, depending on the caller-supplied baseline. Others always
   return offset from border box start edge.

Now:

- `GetNaturalBaselineBOffset` is the sole virtual function.
- `GetLogicalBaseline` exists to support its use, with 2 virtual helper functions:
  - `SynthesizeFallbackBaseline` to generate a baseline for elements that
    doesn't have one.
  - `GetBaselineSharingGroup` to preserve the default baseline picking behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D167990
2023-02-23 14:53:26 +00:00
Ting-Yu Lin a43cae175a Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-26 02:47:40 +00:00
Csoregi Natalia 0492d8333a Backed out 8 changesets (bug 1686603) for causing crashtest failures. CLOSED TREE
Backed out changeset 94b5d0986d27 (bug 1686603)
Backed out changeset e7edf6fcc41d (bug 1686603)
Backed out changeset 4c9271f07178 (bug 1686603)
Backed out changeset 7013b95266ae (bug 1686603)
Backed out changeset cf7a55638aef (bug 1686603)
Backed out changeset 7717a0f2a37b (bug 1686603)
Backed out changeset c82593b13a61 (bug 1686603)
Backed out changeset fd1d95a1e706 (bug 1686603)
2021-01-26 04:32:13 +02:00
Ting-Yu Lin ffce5ed7d6 Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-25 22:29:31 +00:00
Mihai Alexandru Michis b6b2f1e5f4 Backed out 7 changesets (bug 1686603) for causing crashtest assertion failures.
CLOSED TREE

Backed out changeset 19cba7d34a7f (bug 1686603)
Backed out changeset 3a0d0155ea5e (bug 1686603)
Backed out changeset f1f672cdd0c6 (bug 1686603)
Backed out changeset 63020922e2fd (bug 1686603)
Backed out changeset 8766ce79ba5e (bug 1686603)
Backed out changeset 965dbe8de1e1 (bug 1686603)
Backed out changeset b1328ee45f43 (bug 1686603)
2021-01-21 09:21:12 +02:00
Ting-Yu Lin d0c462cb81 Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-21 04:17:59 +00:00
Ting-Yu Lin ecca275fc4 Bug 1168478 Part 2 - Combine the border and padding arguments for nsIFrame::ComputeSize(). r=dholbert
Also combine the border and padding arguments for
nsContainerFrame::ComputeSizeWithIntrinsicDimensions(), too. This method
is used as a helper to implement ComputeSize() for various replaced
elements. Its callers are all within nsIFrame's derived classes'
overridden methods, so I'm not bothering to convert them in a separate
patch.

This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D90064
2020-09-14 20:42:22 +00:00
Ting-Yu Lin a11075f9e1 Bug 1663822 Part 3 - Move ComputeSizeFlags to LayoutConstants.h, and put it under mozilla namespace. r=dholbert
In the next part, I'm going to use ComputeSizeFlags as the arguments in
some ReflowInput's methods. Because nsIFrame.h includes ReflowInput.h,
to solve the circular dependency, ComputeSizeFlags needs to be moved to
somewhere else.

Also, revise the document for ComputeSizeFlag. The rest of the patch is
just dropping `nsIFrame::` and adding `mozilla::` as needed.

This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D89542
2020-09-11 18:32:08 +00:00
Boris Chiou dd3c20ccd8 Bug 1639963 - Update the API of nsIFrame::ComputeSize for aspect-ratio. r=emilio
In order to apply Automatic content-based minimum sizes, we have to know
the content size on the block axis. We cannot get the content size until
we finish the reflow of the child frames. So we have to keep a flag
which indicates the size of the ratio-dependent axis is overrideen by
aspect-ratio in ReflowInput.

We will set the correct return value in the next patch, For now, we
always return AspectRatioUsage::None.

Differential Revision: https://phabricator.services.mozilla.com/D79335
2020-08-17 06:57:56 +00:00
Xidorn Quan fc104758ba Bug 1565681 - Have ruby base container sized based on margin box of ruby bases. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D43353

--HG--
extra : moz-landing-system : lando
2019-09-02 10:09:30 +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
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
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
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
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
Daniel Holbert a7f82bed77 Bug 1412346 part 4: Update stale MPL license boilerplate on a few files in layout. r=jfkthame
We have a fair number of files that have a particular stale version of the MPL
boilerplate.  (It was probably originally correct, and then the official
boilerplate changed, and the stale MPL boilerplate continued to propagate via
copypasting from neighboring files into newly-added files.)

This patch updates this stale MPL text (and *only* the MPL text) to the latest
version, which can be found at https://www.mozilla.org/en-US/MPL/headers/ and
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line

MozReview-Commit-ID: 8WeBb8b0uRo

--HG--
extra : rebase_source : 2c3aa8d07ba23714501c9e26ad03625aeab36a7a
2017-10-27 10:09:35 -07:00
Alexis Beingessner adb013669b Bug 1088760 - Remove nsRenderingContext, replacing all of its uses with gfxContext. r=jwatt,jrmuizel
MozReview-Commit-ID: K1WUIOnvazF
2017-06-13 11:00:10 -04:00
Sebastian Hengst f3bf820bfd Backed out changeset 3d1ce85e6348 (bug 1088760) for bustage, at least on Android at layout/generic/nsPluginFrame.cpp:1612. r=backout 2017-06-13 00:30:03 +02:00
Alexis Beingessner c75211cb95 Bug 1088760 - Remove nsRenderingContext, replacing all of its uses with gfxContext. r=jwatt,jrmuizel
MozReview-Commit-ID: K1WUIOnvazF
2017-06-12 17:32:48 -04:00
Mats Palmgren a254b64145 Bug 1364805 part 4 - Remove the now unused LayoutFrameType values from the ctors. r=jfkthame
MozReview-Commit-ID: 1RSDoc3pQXf
2017-05-26 12:11:11 +02:00
Mats Palmgren 1242172259 Bug 1364805 part 2 - Add a nsIFrame::mClass field and propagate the concrete class' value up the ctor chain. r=jfkthame
nsIFrame::mClass is of type enum class nsQueryFrame::ClassID which is
a strict subset of the nsQueryFrame::FrameIID values.  For a concrete
frame class, its FrameIID is the same numeric value as its ClassID.

MozReview-Commit-ID: 1N0AkCGo1ol
2017-05-26 12:11:11 +02:00
Mats Palmgren ec6b1ef065 Bug 1364805 part 1 - Make every concrete frame class be a NS_DECL_QUERYFRAME_TARGET. r=jfkthame
MozReview-Commit-ID: Gy9gcEYupeY
2017-05-26 12:11:11 +02:00
Emilio Cobos Álvarez 23bce99ae1 Bug 1361051: rename mozilla::FrameType to mozilla::LayoutFrameType. r=xidorn
This avoids conflicts with mozilla::dom::FrameType.

MozReview-Commit-ID: 7aEMbHRaTFk

--HG--
extra : rebase_source : 2d01321f5ce0ec8c0e3f70984674f82678034b3c
2017-05-01 19:32:52 +02:00
Emilio Cobos Álvarez e44543aad4 Bug 1360241: Devirtualize nsIFrame::GetType. r=heycam
MozReview-Commit-ID: 5Nzhyta5Hle

--HG--
extra : rebase_source : c2e9d4bfb9239f5e851d110cd7dff98c1e1a8d8b
2017-04-30 17:30:08 +02:00
Xidorn Quan a4a78e1951 Bug 1267515 part 2 - Place ruby annotations outside annotations from ruby descendants. r=dholbert
MozReview-Commit-ID: Gbo43pC5jqr

--HG--
extra : rebase_source : 893fe9d419be59679febe2de07bbd495ce23e609
2016-10-26 17:40:58 +11:00
Ting-Yu Lin 40fcd21b9a Bug 1277129 Part 7b - Rename various ReflowState variables to ReflowInput. r=dbaron
This patch is generated by the following script:

function rename() {
find .\
     -type f\
     ! -path "./obj*"\
     ! -path "./.git"\
     ! -path "./.hg"\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -r "s/$1/$2/g" "{}" \;
}

rename "([[:alpha:]]*)([rR])eflowState(s?)" "\1\2eflowInput\3"

MozReview-Commit-ID: ITFO7uMTkSb

--HG--
extra : rebase_source : c91a2e174a0baec60c1b0111ac7636295004ab35
2016-07-21 18:36:39 +08:00
Ting-Yu Lin 7a5825e82f Bug 1277129 Part 7a - Rename ReflowState to RubyReflowInput in nsRubyBaseContainerFrame. r=dbaron
This is a prerequisite for the mass rename variables whose name
containing ReflowState in the next patch. Otherwise
nsRubyBaseContainerFrame::ReflowInput will conflict with
mozilla::ReflowInput.

MozReview-Commit-ID: KUU51Rjn6z

--HG--
extra : rebase_source : fcb3aefaea40f57e59cc81349b9fcc0f3a88394a
2016-07-21 18:36:38 +08:00
Ting-Yu Lin 4053c4c028 Bug 1277129 Part 5c - Rename nsHTMLReflowMetrics to ReflowOutput. r=dbaron
This patch is generated by the following script:

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 "nsHTMLReflowMetrics" "ReflowOutput"

MozReview-Commit-ID: 2HBb7DkooH5

--HG--
extra : rebase_source : acfa442a6483772fcb5748dc6f5e7072e599032a
2016-07-21 18:36:38 +08:00
Ting-Yu Lin 820f88de49 Bug 1277129 Part 1c - Rename nsHTMLReflowState to ReflowInput. r=dbaron
This patch is generated by the following script:

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 nsHTMLReflowState ReflowInput

MozReview-Commit-ID: 9r9vdVv1pXc

--HG--
extra : rebase_source : 623ec822996ba0ea0058dd137acf5a658cdea04a
2016-07-21 18:36:35 +08:00
Xidorn Quan 1ed71b2fe7 Backed out 8 changesets (bug 1225018, bug 1229278, bug 1224013) for reftest failures on CLOSED TREE
--HG--
extra : amend_source : ee1d38ab6715e193cb1462614b3395c96ca06a0c
extra : histedit_source : 65b6dcb58b89c3cbcfe9a47834baf3181a2990c8%2Cc19e313c6800de1a1906c0db2f2bd4680fe67b78
2015-12-04 13:08:17 +11:00
Xidorn Quan 45ebb9aa0e Bug 1224013 part 2 - Move leading fix to ruby base container. r=dholbert
Per spec, the additional leading is added on side of ruby base container, not
ruby container. This could lead to some trivial behavior changes on edge cases.

--HG--
extra : source : 495e466ebdb628fecd9a546b539001ac316fc133
2015-12-04 12:02:41 +11:00
Birunthan Mohanathas a8939590de Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Xidorn Quan 59d1864c8a Bug 1141931 part 7 - Move [Auto]RubyTextContainerArray to RubyUtils and merge RubyTextContainerIterator into AutoRubyTextContainerArray. r=dholbert
--HG--
extra : source : 89ae2f9a195fe10f4db19d0a51fd3ec7bafb0ecc
2015-04-08 11:22:34 +12:00
Xidorn Quan 966ef97045 Bug 1141931 part 6 - Move Ruby{Segment,Column}Enumerator to RubyUtils. r=dholbert
--HG--
extra : source : 2327584c7a0740617388bc544d2bb8433d034fe7
2015-04-08 11:22:34 +12:00
Xidorn Quan ddd0a788fa Bug 1141931 part 5 - Eliminate unnecessary includes in header files of ruby frames. r=dholbert
--HG--
extra : source : 860c66b5f319ed0744decf84c8c2145efd85ce83
2015-04-08 11:22:34 +12:00
Wes Kocher 74f58c915e Backed out 10 changesets (bug 1141931) for mochitest-5 failures CLOSED TREE
Backed out changeset c90940067de6 (bug 1141931)
Backed out changeset 96b48288abab (bug 1141931)
Backed out changeset 87281c7ded34 (bug 1141931)
Backed out changeset 6a914ba0b8ec (bug 1141931)
Backed out changeset 9cfea55b5e95 (bug 1141931)
Backed out changeset f432612b6475 (bug 1141931)
Backed out changeset 48cf9568a4b1 (bug 1141931)
Backed out changeset f1ab848b3fa6 (bug 1141931)
Backed out changeset 8a3c71a3b525 (bug 1141931)
Backed out changeset 119d3c0fd0f6 (bug 1141931)
2015-04-07 14:23:57 -07:00
Xidorn Quan 53a7f5a9f8 Bug 1141931 part 7 - Move [Auto]RubyTextContainerArray to RubyUtils and merge RubyTextContainerIterator into AutoRubyTextContainerArray. r=dholbert
--HG--
extra : source : 89ae2f9a195fe10f4db19d0a51fd3ec7bafb0ecc
2015-04-08 08:40:31 +12:00
Xidorn Quan 1bbf61d898 Bug 1141931 part 6 - Move Ruby{Segment,Column}Enumerator to RubyUtils. r=dholbert
--HG--
extra : source : 2327584c7a0740617388bc544d2bb8433d034fe7
2015-04-08 08:40:31 +12:00
Xidorn Quan 27d78f6b41 Bug 1141931 part 5 - Eliminate unnecessary includes in header files of ruby frames. r=dholbert
--HG--
extra : source : 860c66b5f319ed0744decf84c8c2145efd85ce83
2015-04-08 08:40:31 +12:00
Ehsan Akhgari 883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Xidorn Quan 7969797ad3 Bug 1055658 part 4 - Revert RubyReflowState. r=dbaron
--HG--
extra : source : 27e60ddbd077439dadd09641ab54fc7eef09c69f
2015-01-13 20:04:41 +11:00
Nigel Babu 053a7d3408 Backed out 4 changesets (bug 1055658) for M5 bustage on a CLOSED TREE
Backed out changeset 3cbd9323c896 (bug 1055658)
Backed out changeset 99e071295c42 (bug 1055658)
Backed out changeset 55119d19e4c5 (bug 1055658)
Backed out changeset e82f640cb53f (bug 1055658)
2015-01-12 10:43:11 +05:30
Xidorn Quan 6ba35e648b Bug 1055658 part 4 - Revert RubyReflowState. r=dbaron
--HG--
extra : source : 27e60ddbd077439dadd09641ab54fc7eef09c69f
2015-01-12 14:31:55 +11:00
Xidorn Quan 3013e06e68 Bug 1116037 part 11 - Add RubyReflowState for sharing states between ruby level boxes. r=dbaron
--HG--
extra : source : c4f342ece9c1548053348dbc317d9857cbe790b6
2014-12-30 11:16:30 +11:00
Xidorn Quan 09350f0596 Bug 1116037 part 10 - Remove mColumnCount from nsRubyBaseContainerFrame. r=dbaron
--HG--
extra : source : 36096895ec5437c5f9cf6c97d6085bfeae8654c7
2014-12-30 10:05:54 +11:00
Xidorn Quan eb1ae2b722 Bug 1116037 part 9 - Move ruby text container arrays to stack. r=dbaron
--HG--
extra : source : 6c5d7212c3f8c355b4667aa46024dfef0710ca8e
2014-12-30 09:56:34 +11:00
Xidorn Quan 62bf8b83b1 Bug 1116037 part 8 - Merge two ruby text container arrays. r=dbaron
--HG--
extra : source : 2b3f8e1951d924c14c94c06a44012837b51a04ad
2014-12-30 09:44:12 +11:00