Commit Graph

66 Commits

Author SHA1 Message Date
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
828b7077b9 Bug 1379332: When computing abspos CB content-box size, don't bother subtracting borderpadding if CB is a 0-sized child of a XUL-collapsed frame. r=mats
If border & padding were ignored for sizing the containing block (which can
happen, if the containing block is a chlid of a XUL-collapsed frame), then we
don't need to subtract border & padding when computing the frame's content-box
size for its abspos descendants.

MozReview-Commit-ID: JGnzShl8m67

--HG--
extra : rebase_source : 1cead4ce6b403af634c8f9bde0852dce4ee7edc5
2017-10-20 16:40:43 -07:00
Jonathan Watt
bcaeb4d9e8 Bug 1379474 - Update various ReflowInput variable names to match the new type name. r=xidorn
MozReview-Commit-ID: 1pMLInpeMGY
2017-07-25 12:02:35 +01:00
Sylvestre Ledru
7c0ae251cd Bug 1381253 - Remove redundant control flow declarations rs=ehsan
MozReview-Commit-ID: FFxP4aMCbOL

--HG--
extra : amend_source : 3aec108430b11048f47ffe19d5da7ac5034770a9
2017-07-15 19:03:04 +02:00
L. David Baron
46238dd351 Bug 1308876 - Preserve behavior of ignoring parent dirty bit for column groups. r=dholbert
In the existing code, the parent having NS_FRAME_IS_DIRTY is not
propagated to column groups because nsTableFrame::ReflowColGroups checks
the child dirty bit before constructing the reflow state for the child.
This preserves that behavior in the presence of the primary patch in bug
1308876.

I noticed this while debugging the assertion count failure of
layout/base/crashtests/470851-1.xhtml .  It doesn't help that failure,
but it still seems like the safe thing to do.

MozReview-Commit-ID: EhfIQQkeaJx
2017-07-12 19:37:12 -07:00
L. David Baron
6edf234e49 Bug 1308876 - Mark child frames as dirty before starting reflow of the parent, so that if we reflow a child twice, it's only dirty the first time. r=dholbert
This is the primary patch in this bug, and makes the performance
improvement that fixes this bug.

The assertion count increase for layout/generic/crashtests/1015844.html
is accompanied by a layout change in the testcase as well.  However, I'm
not planning to fix it in this sequence; fundamentally columnsets with
specified heights inside a paginated context (like another columnset) do
not work in any reasonable way, and changing the number of times we
reflow them can change the layout.  At least, assuming I didn't lose
something in the process of simplifying the testcase.

ISSUES:
 - may make block inside XUL worse in performance by marking dirty more (see subdoc in Firefox UI, or text control innards?)

MozReview-Commit-ID: GdOvPynqcFP
2017-07-12 19:37:12 -07:00
Boris Zbarsky
190842b75b Bug 667079. Make sure to set the right containing block size for inner tables no matter what. r=dbaron
MozReview-Commit-ID: 3EwrNfgJ2oA
2011-06-25 01:21:47 -04:00
Carsten "Tomcat" Book
6121e5b902 Backed out changeset 31c43a9ffa8b (bug 1379474) for bustage 2017-07-10 08:06:30 +02:00
Jonathan Watt
b4ab3914e7 Bug 1379474 - Update various ReflowInput variable names to match the new type name. r=xidorn
MozReview-Commit-ID: 1pMLInpeMGY
2017-06-13 11:45:17 +01:00
L. David Baron
d4c979a87f Bug 1377497 - Pass the correct writing mode to SizeComputationInput::DisplayInitOffsetsEnter. r=jfkthame
This avoids asserting when the writing mode doesn't correspond to the
one stored (DEBUG-only) in aPercentBasis.

MozReview-Commit-ID: KKqms9X17SS
2017-07-07 09:20:56 -07:00
Sebastian Hengst
629ef010df Backed out changeset f07caa23cdbb (bug 1377497) for bustage at layout/generic/ReflowInput.cpp:2543: macro "DISPLAY_INIT_OFFSETS" passed 6 arguments, but takes just 5. r=backout on a CLOSED TREE
--HG--
extra : amend_source : 3666e631a99bdda91c09e2a1237e0e4ab65fdfba
2017-07-07 18:52:50 +02:00
L. David Baron
609b65745d Bug 1377497 - Pass the correct writing mode to SizeComputationInput::DisplayInitOffsetsEnter. r=jfkthame
This avoids asserting when the writing mode doesn't correspond to the
one stored (DEBUG-only) in aPercentBasis.

MozReview-Commit-ID: KKqms9X17SS

--HG--
extra : transplant_source : %0Eh%09F%17%15%0D%D1%D3%DA%9B%85%21z%ED%3Dx%EA%F9%E8
2017-07-07 09:20:56 -07:00
Sylvestre Ledru
4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02: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
357e4b9560 bug 1368547 part 2 - Remove nsFrameManager/PresShell methods dealing with placeholders and introduce a nsIFrame::GetPlaceholderFrame() convenience method. r=jfkthame
MozReview-Commit-ID: GBUiUBqJxhQ
2017-05-31 21:29:49 +02:00
Jonathan Kew
18938a04a9 Bug 1367711 - Bail out early when initializing ReflowInput for a placeholder frame, which has a trivial Reflow method. r=mats 2017-05-30 23:55:02 +01:00
Jonathan Kew
ee384ef57b Bug 1368249 - Create nsIFrame::AddProperty API for use when the property is known to not already exist, and use to optimize some call sites. r=mats 2017-05-28 13:16:55 +01:00
Sebastian Hengst
99f17a4e95 Backed out changeset 59c0589220ec (bug 1368249) unused function GetNormalPosition at nsIFrame.h:1073. r=backout 2017-05-28 15:38:15 +02:00
Jonathan Kew
1f8beade4e Bug 1368249 - Create nsIFrame::AddProperty API for use when the property is known to not already exist, and use to optimize some call sites. r=mats 2017-05-28 13:16:55 +01:00
Jonathan Kew
a8f81efd8e Bug 1365982 - Attach frame properties to each frame instead of looking them up in a hashtable on the prescontext. r=mats
--HG--
rename : layout/base/FramePropertyTable.cpp => layout/base/FrameProperties.cpp
rename : layout/base/FramePropertyTable.h => layout/base/FrameProperties.h
2017-05-27 12:36:00 +01:00
Mats Palmgren
f9096282d3 Bug 1359341 part 3 - Propagate AreAllEarlierInFlowFramesEmpty() state on placeholders down the line. We can stop iterating siblings if we find a placeholder with a stored state. r=jfkthame
MozReview-Commit-ID: DNtcNIEwA5P
2017-05-23 19:09:27 +02:00
Mats Palmgren
5f995975b4 Bug 1359341 part 1 - Make PresShell::GetPlaceholderFrameFor return a nsPlaceholderFrame. r=jfkthame
MozReview-Commit-ID: AvfQcCtVMta
2017-05-23 19:09:26 +02:00
Mats Palmgren
297b9d70e1 Bug 1365614 part 3 - Backout bug 1333482 part 1-9. Removes support for [-webkit-]appearance for now b/c web compat issues. r=bz
MozReview-Commit-ID: IbwWM0FL6HF

--HG--
extra : source : bbb688fe1ba3f5201a190c6e25b693ef7272ea2d
2017-05-21 17:15:00 +08:00
Carsten "Tomcat" Book
00d4ea331d Backed out changeset bbb688fe1ba3 (bug 1365614) 2017-05-22 15:45:31 +02:00
Mats Palmgren
e706869580 Bug 1365614 part 3 - Backout bug 1333482 part 1-9. Removes support for [-webkit-]appearance for now b/c web compat issues. r=bz 2017-05-21 17:15:00 +08:00
Jonathan Kew
fef41b2663 Bug 1365356 - patch 3 - Allow callers to pass an nsStyleDisplay to GetContainingBlock (and IsAbsolutelyPositioned, which it calls) if they have it on hand, to avoid internal calls to StyleDisplay(). r=mats 2017-05-17 15:47:36 +01:00
Jonathan Kew
97a920ea30 Bug 1365356 - patch 1 - When initializing a ReflowInput, pass the nsStyleDisplay in to InitOffsets to avoid internal StyleDisplay() calls. r=mats 2017-05-17 15:47:25 +01:00
Xidorn Quan
8c54e3ce73 Bug 1363699 part 1 - Make named CounterStyle objects not refcounted. r=heycam
This change does the following:
* Introduce a new smart pointer called CounterStylePtr which either
  holds an AnonymousCounterStyle strongly, or a named CounterStyle
  managed by CounterStyleManager weakly, and use it to replace all
  RefPtr<CounterStyle> around the codebase.
* Rename CounterStyleManager::mCacheTable to mStyles to reflect the
  fact that it is used to manage all styles, not just for caching.
* Add a retired styles list which collect all named CounterStyle
  evicted from mStyles, and post a PostRefreshObserver to destroy
  objects in that list after next flush.
* Remove helper functions for counter style in nsStyleList and expose
  mCounterStyle directly, to make code simpler with the new pointer.

Reason for adding a new smart pointer type rather than making their
AddRef/Release behave like BuiltinCounterStyle is that, it is possible
that after a flush, some stale style structs may still be alive. They
can contain pointer to destroyed CounterStyle objects. Although the
actual content may never be accessed anymore, RefPtr may still access
the object for refcounting during destruction.

MozReview-Commit-ID: xxegwSDhNb

--HG--
extra : rebase_source : bb5443f0eb56eee51cbdfd08e0400335648610e8
2017-05-13 21:42:23 +10:00
Wes Kocher
df3f95a52f Merge inbound to m-c a=merge
MozReview-Commit-ID: 4SpokMW1d3I
2017-05-02 17:35:06 -07:00
Emilio Cobos Álvarez
cc46407803 Bug 1361368: Don't unnecessarily nullcheck the parent frame in ReflowInput::InitConstraints. r=mats
That function has a special path for when there's no parent reflow input, and if
there's a parent reflow input there should always be a parent frame.

MozReview-Commit-ID: EYh0aE4ozBg
2017-05-02 18:15:50 +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
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
Mats Palmgren
c02d9817f3 Bug 1348857 part 2 - [css-grid] Propagate the ApplyAutoMinSize bit to nsFrame::ComputeSize (idempotent patch). r=dholbert
MozReview-Commit-ID: DBU4hDfCAdE
2017-04-18 22:35:04 +02:00
Boris Zbarsky
148f51a721 Bug 1351926. Set the resize flags to false at the beginning of InitResizeFlags, so stale values from an old (incorrect) computed bsize won't keep being propagated in cases when we SetComputedWidth or SetComputedHeight on the ReflowInput. r=dbaron
MozReview-Commit-ID: 56YFAw3KOmi
2017-04-05 23:07:40 -04:00
Ting-Yu Lin
5696ee9603 Bug 1322570 Part 2 - Resolve {align,justify}-self using StyleContext from alignment container frame in ReflowInput::InitConstraints(). r=dholbert
Per bug 1322570 comment 46, it's not easy to replace ComputedJustifyItems()
and UsedJustifySelf()'s internal nsStyleContext::GetParent() without
correctness penalty, so we use GetParentAllowServo() for now.

Also, fix the reftest.list added in bug 1334403 which incorrectly wrote test
page as reference page.

MozReview-Commit-ID: 6kAAWSFojd5

--HG--
extra : rebase_source : 2d03302115dd40281cec27bc18750b6933682855
2017-03-20 14:12:08 +08:00
Mats Palmgren
79cff05243 Bug 1333482 part 2 - [css-ui] Change all consumers of StyleDisplay::mAppearance to use the accessor UsedAppearance() instead, and make mAppearance/mMozAppearance private. r=dholbert
MozReview-Commit-ID: 8JwLsY1CLDJ
2017-03-23 22:11:18 -07:00
cku
a52259bf72 Bug 1349462 - Part 1. Rename IsSVGText as IsInSVGTextSubtree. r=heycam
MozReview-Commit-ID: LTo6c8tTtaf

--HG--
extra : rebase_source : bc6913c42cca141d7a3098fdd4dcc72fbf146b5a
2017-03-23 15:29:11 +08:00
Ting-Yu Lin
e015259441 Bug 775624 Part 10a - Move ReflowInput::SetTruncated() into nsReflowStatus. r=dholbert
Per bug 775624 comment 95, the method modifies only nsReflowStatus, and is
lived in ReflowInput only because nsReflowStatus was an uint32_t. So it's
better to move it into nsReflowStatus.

MozReview-Commit-ID: DSY2u9az67A

--HG--
extra : rebase_source : dcf9404d40043a749edcad2cb969f1227a300936
2017-02-20 14:58:58 +08:00
Mats Palmgren
0d8685f315 Bug 1334403 - Make <caption> inline size stretch again for table flex items. r=dholbert 2017-01-29 04:02:59 +01:00
Mats Palmgren
3e56c9e74d Bug 1325970 - Treat display:flow-root as a block-ish frame type. r=dholbert 2016-12-28 15:26:35 +01:00
Cameron McCormack
f5bb6f2dfd Bug 1322185 - Rename some StyleDisplay enum values for consistency. r=xidorn
MozReview-Commit-ID: K27LmXKWNdk
2016-12-05 21:36:28 -10:00
Ting-Yu Lin
c9cfd878cb Bug 1317588 Part 2 - Remove mozilla::css::Side typedef. r=mats
This patch is written with the help of 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 "css::Side" "Side"

MozReview-Commit-ID: DPV6vivpPUp

--HG--
extra : rebase_source : 9c4f66dc9d2b26c89a4517fba4ff9c5db413411b
2016-11-18 16:28:38 +08:00
Mats Palmgren
a8c4f0a7da Bug 1316051 part 4 - [css-grid][css-flexbox] Use the alignment container of the table-wrapper frame also for its child frames. r=dholbert 2016-11-18 19:08:31 +01:00
Mats Palmgren
03e09101c9 Bug 1316649 - A parent dummy ReflowInput is also the CB ReflowInput. r=dholbert 2016-11-11 18:28:43 +01:00
Daniel Holbert
d36239361c Bug 1269017 part 4 - [css-grid] When doing CSS Box Alignment, opt out of a CalculateHypotheticalPosition() clause that disregards placeholder's inline position. r=mats
(We don't want to disregard this position -- it's what we use to encode the
start of the alignment container for this child, when we're doing CSS Box
Alignment. So we need it to be reflected in the hypothetical position, not
disregarded.)

MozReview-Commit-ID: 28IgPn8z1Hr
2016-11-08 16:30:00 -08:00
Daniel Holbert
b48516cdb2 Bug 1269017 part 3 - [css-grid] Reduce scope of a mStaticPosIsCBOrigin check to *just* cover hypothetical-position calculation, and update comments. r=mats
Previously, I'd thought the "mStaticPosIsCBOrigin" flag was going to become
obsolete -- but now I've realized it's quite useful to avert mixup between the
coordinate space of the grid vs. the coordinate space of
grid-areas-acting-as-abspos-containing-blocks.

So, this patch clarifies/removes some stale comments about this flag, and also
pulls out some code that was unnecessarily in an "else" clause, so that it
happens regardless of whether this flag is set.

(Note: the InitAbsoluteConstraints changes are basically just code-reordering & deindentation.)

MozReview-Commit-ID: 9TFrOuldVBe
2016-11-08 16:30:00 -08:00
Mats Palmgren
6b1b0153ba Bug 1300369 part 11 - Move nsLayoutUtils::ComputeISizeValue to a nsIFrame method (idempotent patch). r=dholbert 2016-11-05 02:57:07 +01:00
Mats Palmgren
d523cbcf73 Bug 1300369 part 1 - Add two new ComputeSizeFlags flags e{I,B}ClampMarginBoxMinSize and associated reflow state flags to indicate we want margin-box min-size clamping in the indicated axis. r=dholbert 2016-11-05 02:57:06 +01:00