Commit Graph

1109 Commits

Author SHA1 Message Date
Boris Zbarsky
b6041718b5 Bug 1340723 part 1. Add an nsIFrame function that can be called from the stylo restyle manager to update style contexts on anonymous boxes associated with that frame, and a frame state bit that can be used to optimize out the virtual calls. r=emilio
MozReview-Commit-ID: 2niUdJPSXKa

--HG--
extra : rebase_source : cfacb4cd47677d2589323c0cda8892226b698eef
2017-03-03 15:44:24 -05:00
Carsten "Tomcat" Book
4a4777d1aa merge mozilla-inbound to mozilla-central a=merge 2017-03-02 14:02:48 +01:00
Mats Palmgren
742155bd91 Bug 1340771 part 4 - Mark AutoWeakFrame as MOZ_NONHEAP_CLASS and WeakFrame as MOZ_HEAP_CLASS. r=tn
MozReview-Commit-ID: 8yGBKyx3TDW
2017-03-01 18:03:14 +01:00
Mats Palmgren
6ef6efaea3 Bug 1340771 part 2 - Introduce a WeakFrame class for heap allocated weak frame pointers, stored in a hashtable for fast lookup. r=tn
* * *
Bug 1340771 part 3 - Change existing heap allocated AutoWeakFrame instances to use WeakFrame instead.  r=tn

MozReview-Commit-ID: GSuUiy98jBa
2017-03-01 18:03:14 +01:00
Mats Palmgren
d13aaf9ce0 Bug 1340771 part 1 - Rename nsWeakFrame to AutoWeakFrame (automated change). r=tn
MozReview-Commit-ID: 8pl4nyeGEkr
2017-03-01 18:03:14 +01:00
Mats Palmgren
e8c6fd3388 Bug 1342801 - Store the 'writing-mode' used value on nsIFrame and make GetWritingMode non-virtual. r=jfkthame
MozReview-Commit-ID: HPhuxjDbOdh
2017-02-28 18:58:30 +01:00
Ting-Yu Lin
cd607fcae6 Bug 775624 Part 24 - Implement operator<< for nsReflowStatus to use mozilla::ToString. r=dholbert
To print log in nsBlockFrame, run "GECKO_BLOCK_DEBUG_FLAGS=reflow ./mach run".

Here is a sample nsReflowStatus string:
[Complete=Y,NIF=N,Truncated=N,Break=N,FirstLetter=Y].

MozReview-Commit-ID: 4voGcXfJlN7

--HG--
extra : rebase_source : f84ba1ef47e30513674e578fab37b66a8b2a1ab3
2017-02-14 18:41:41 +08:00
Ting-Yu Lin
10070b1da2 Bug 775624 Part 23 - Remove constructor and all operators related to uint32_t. r=dholbert
MozReview-Commit-ID: FEVYMhcpPS0

--HG--
extra : rebase_source : 504328a609feaf7816e22e0f0c87aa8be6813558
2017-02-14 18:01:11 +08:00
Ting-Yu Lin
8f840dc923 Bug 775624 Part 22 - Remove NS_FRAME_COMPLETE. r=dholbert
This patch is written by the following script with some manual adjustment to
the comment in nsRubyTextContainerFrame.cpp and nsRubyFrame.cpp, and
nsColumnSetFrame's constructor.

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

rename "nsReflowStatus *([a-zA-Z0-9]*) = NS_FRAME_COMPLETE" "nsReflowStatus \1"
rename "([a-zA-Z0-9.*]*) *= NS_FRAME_COMPLETE;" "\1.Reset();"
rename "([a-zA-Z0-9.*]*) == NS_FRAME_COMPLETE" "\1.IsEmpty()"

MozReview-Commit-ID: 9tqQAHvdQex

--HG--
extra : rebase_source : 3119776946dc2c8350098b7bf9f3ceff29bdffb5
2017-02-14 17:55:48 +08:00
Ting-Yu Lin
f19bfc4b93 Bug 775624 Part 21 - Remove NS_FRAME_NOT_COMPLETE. r=dholbert
To preserve the semantics, Reset() is called to clear other bits in the
status prior to set the incomplete bit. Though some of them might not be
necessary.

MozReview-Commit-ID: InNDwcpp28A

--HG--
extra : rebase_source : 833e44a5dbb447d82c67f715cd5b0b2e97a5c62d
2017-02-14 17:30:56 +08:00
Ting-Yu Lin
19c8d3d9bf Bug 775624 Part 20 - Remove NS_FRAME_OVERFLOW_INCOMPLETE. r=dholbert
MozReview-Commit-ID: ATzg0IdIjd8

--HG--
extra : rebase_source : f5e1e9a6e2ba8231962824c044a49e3abe64ab4f
2017-02-14 17:22:09 +08:00
Ting-Yu Lin
37d27159af Bug 775624 Part 19 - Convert NS_INLINE_BREAK_FIRST_LETTER_COMPLETE to use bit-field and methods. r=dholbert
MozReview-Commit-ID: k1CSWJNMns

--HG--
extra : rebase_source : 1aa775a1e835f3d001f8b2093d0c4fb9f6651630
2017-02-14 17:09:37 +08:00
Ting-Yu Lin
65116ee49c Bug 775624 Part 18 - Convert NS_INLINE_IS_BREAK to a method. r=dholbert
MozReview-Commit-ID: 7Tw1BUjOYgg

--HG--
extra : rebase_source : 907596f5a59dea709063d1f329a2155a430f41fc
2017-02-14 16:33:37 +08:00
Ting-Yu Lin
8f66d2167b Bug 775624 Part 17 - Convert NS_INLINE_IS_BREAK_AFTER to a method. r=dholbert
MozReview-Commit-ID: CD9uuOC3CzP

--HG--
extra : rebase_source : e7a12a1b37f591ba33e4ed8e73502f7cddf5d619
2017-02-14 16:22:04 +08:00
Ting-Yu Lin
d5c6d28836 Bug 775624 Part 16 - Convert NS_INLINE_IS_BREAK_BEFORE to a method. r=dholbert
MozReview-Commit-ID: 8vxRpqbZNnk

--HG--
extra : rebase_source : 195e2da23d64da9e9a888968a45eaae2e6539585
2017-02-14 16:05:24 +08:00
Ting-Yu Lin
19221f0474 Bug 775624 Part 15 - Remove NS_INLINE_BREAK_TYPE_MASK. r=dholbert
MozReview-Commit-ID: BjDou96ojUd

--HG--
extra : rebase_source : 238d8c80e2dcc347101b8941bca01e4a2f6304c6
2017-02-14 16:05:24 +08:00
Ting-Yu Lin
1c0431a402 Bug 775624 Part 14 - Convert NS_INLINE_GET_BREAK_TYPE to a method. r=dholbert
MozReview-Commit-ID: CAYlv21gPpR

--HG--
extra : rebase_source : f1d44d9ccac983f2051f09f17bf662b5bfad76e3
2017-02-14 15:58:03 +08:00
Ting-Yu Lin
d1e11eca37 Bug 775624 Part 13 - Convert NS_INLINE_LINE_BREAK_AFTER to a method. r=dholbert
NS_INLINE_MAKE_BREAK_TYPE is used only in BRFrame. Delete it, too.

MozReview-Commit-ID: GC4vF0GFsAD

--HG--
extra : rebase_source : d7727fe41410a8998142d9ded8dcd8ae9c2a780f
2017-02-14 11:52:53 +08:00
Ting-Yu Lin
56ebb62910 Bug 775624 Part 12 - Add bit-fields for inline break status, and convert NS_INLINE_LINE_BREAK_BEFORE. r=dholbert
NS_INLINE_LINE_BREAK_BEFORE() was replaced by the help of the following script.

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

rename " = NS_INLINE_LINE_BREAK_BEFORE\(\);" ".SetInlineLineBreakBeforeAndReset();"

MozReview-Commit-ID: mz6L8zay7q

--HG--
extra : rebase_source : fddffa1288c7a52c7245aec0839a65f8d1d3f008
2017-02-14 11:52:53 +08:00
Ting-Yu Lin
19a2af3275 Bug 775624 Part 11 - Convert NS_MergeReflowStatusInto() to a method. r=dholbert
Also, remove NS_FRAME_TRUNCATED and NS_FRAME_REFLOW_NEXTINFLOW because both
are used only by NS_MergeReflowStatusInto().

MozReview-Commit-ID: LsPOji9j2e

--HG--
extra : rebase_source : 7cf1421c066f0f8df3e8402b84ae0f584cad2d11
2017-02-13 17:15:01 +08:00
Ting-Yu Lin
a4633d568d Bug 775624 Part 10b - Convert NS_FRAME_TRUNCATED to use bit-field and methods. r=dholbert
NS_FRAME_TRUNCATED will be removed when NS_MergeReflowStatusInto() is
removed.

MozReview-Commit-ID: 21lit9xSAE1

--HG--
extra : rebase_source : 7933575a2f4d3c8ccff5d717fca1ddd8c7c9e482
2017-02-13 16:16:44 +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
Ting-Yu Lin
11579e0ce5 Bug 775624 Part 9 - Convert NS_FRAME_REFLOW_NEXTINFLOW to use bit-field and methods. r=dholbert
MozReview-Commit-ID: 1TXOShK62X8

--HG--
extra : rebase_source : df0b26da3aefc239f11c28ccc746062e88ab86a3
2017-02-13 14:56:45 +08:00
Ting-Yu Lin
b7c479e1c2 Bug 775624 Part 8 - Remove NS_FRAME_SET_OVERFLOW_INCOMPLETE. r=dholbert
This patch is written by the help of the following script.

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

rename "NS_FRAME_SET_OVERFLOW_INCOMPLETE\(\*([a-zA-Z0-9.*]*)\)" "\1->SetOverflowIncomplete()"
rename "NS_FRAME_SET_OVERFLOW_INCOMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.SetOverflowIncomplete()"

MozReview-Commit-ID: EJOIs84vwev

--HG--
extra : rebase_source : 59a5ac827f57e7a0e50910f5a813c44560baeb00
2017-02-11 23:18:04 +08:00
Ting-Yu Lin
14b6536193 Bug 775624 Part 7 - Remove NS_FRAME_SET_INCOMPLETE. r=dholbert
This patch is written by the help of the following script.

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

rename "NS_FRAME_SET_INCOMPLETE\(\*([a-zA-Z0-9.*]*)\)" "\1->SetIncomplete()"
rename "NS_FRAME_SET_INCOMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.SetIncomplete()"

MozReview-Commit-ID: GOd4y2N6dcz

--HG--
extra : rebase_source : 185f5d6f5a3c8306761860c579eff10d931f3b35
2017-02-11 23:06:17 +08:00
Ting-Yu Lin
ba8d9f3b05 Bug 775624 Part 6 - Remove NS_FRAME_OVERFLOW_IS_INCOMPLETE. r=dholbert
This patch is written by the help of the following script.

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

rename "NS_FRAME_OVERFLOW_IS_INCOMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.IsOverflowIncomplete()"

MozReview-Commit-ID: GOd4y2N6dcz

--HG--
extra : rebase_source : 2945ff0274d91137249eb2b5a053eeec08864a25
2017-02-11 22:54:26 +08:00
Ting-Yu Lin
f7a393e947 Bug 775624 Part 5 - Remove NS_FRAME_IS_COMPLETE. r=dholbert
This patch is written by the help of the following script.

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

rename "NS_FRAME_IS_COMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.IsComplete()"

MozReview-Commit-ID: GOd4y2N6dcz

--HG--
extra : rebase_source : aa8b11d3a756c9e7c521e6ffd70713af0174bd98
2017-02-11 22:45:07 +08:00
Ting-Yu Lin
99ebdf6cf3 Bug 775624 Part 4 - Remove NS_FRAME_IS_FULLY_COMPLETE. r=dholbert
This patch is written by the help of the following script.

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

rename "NS_FRAME_IS_FULLY_COMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.IsFullyComplete()"

MozReview-Commit-ID: GOd4y2N6dcz

--HG--
extra : rebase_source : 200639e836cebe26fd77cde21f478fd027e1725f
2017-02-11 22:38:48 +08:00
Ting-Yu Lin
b31150930a Bug 775624 Part 3 - Remove NS_FRAME_IS_NOT_COMPLETE. r=dholbert
This patch is written by the help of the following script.

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

rename "NS_FRAME_IS_NOT_COMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.IsIncomplete()"

MozReview-Commit-ID: GOd4y2N6dcz

--HG--
extra : rebase_source : 412b60e7954118d8443ebf2a786046d7cd38c516
2017-02-11 22:17:26 +08:00
Ting-Yu Lin
36df42df35 Bug 775624 Part 2 - Add bit-fields and methods for frame completion status. r=dholbert
MozReview-Commit-ID: B2DEaWYTtAE

--HG--
extra : rebase_source : a468e954a7f963b947e5ed1366d6f361ab361bad
2017-02-13 15:25:50 +08:00
Ting-Yu Lin
9c347956ae Bug 775624 Part 1 - Convert nsReflowStatus to a class mimicking uint32_t. r=dholbert
Lay down the foundation for this refactor work so that nsReflowStatus could
be converted to bit-fields piece by piece, and each patch can be built (but
may not pass tests).

This change causes some build warnings, due to some debug logs printing
nsReflowStatus as an integer, but that will be fixed by Part 24 later.

All the operators related to uint32_t will be removed at the end of this
patch series by Part 23.

The yoda conditions are swapped in order to build successfully.

DisplayReflowExit() incorrectly declares aStatus as uint32_t. Change it to
const reference because nsReflowStatus is now a class.

MozReview-Commit-ID: 5DOpaP85ywJ

--HG--
extra : rebase_source : 53ca0750b5f764fcbf7ba2d00c9ec606aed704c2
2017-02-10 17:29:10 +08:00
Carsten "Tomcat" Book
19b6ae43dc Merge mozilla-central to autoland 2017-03-01 16:43:23 +01:00
Ting-Yu Lin
6ef981dc18 Bug 1341981 Part 3 - Convert inline break status to a tri-state enum class. r=dholbert
MozReview-Commit-ID: DwbffoPR0Q5

--HG--
extra : rebase_source : 97b62dd2630c34a767cdcbeafedcb279ebc58def
2017-02-26 00:25:12 +08:00
Ting-Yu Lin
d65aeffe68 Bug 1341981 Part 2 - Convert frame completion status to a tri-state enum class. r=dholbert
MozReview-Commit-ID: 8DrGnwoRz7

--HG--
extra : rebase_source : 07bb2c31df78113fc73024a6da6bec7d7d548976
2017-02-24 14:34:50 +08:00
Ting-Yu Lin
15b1392241 Bug 1341981 Part 1 - Strip trailing whitespaces in nsIFrame.h. r=dholbert
MozReview-Commit-ID: 1uZmXwlk1CE

--HG--
extra : rebase_source : c34a67bb932372723aed3926a06f42b9f014d092
2017-02-24 10:56:32 +08:00
Jeff Walden
cdee578059 Bug 1287006 - Don't pass Maybe (or any class containing a Maybe member) by value, only by reference or pointer, in layout/-related code. r=bz
--HG--
extra : rebase_source : 94377970d6ec591044a10dab1aa5568e4a051837
2017-02-13 09:07:40 -08:00
Ting-Yu Lin
88f22bd389 Bug 1333366 Part 2 - Update legacy NS_SIDE usage and document. r=mats
Delete the "or 0 for no movement in that direction" from the CanAdjustEdges
document in nsMenuPopupFrame.h because the only caller in nsResizerFrame.cpp
never passes 0 to it.

MozReview-Commit-ID: 3A5A8O4MDn1

--HG--
extra : rebase_source : 3a961f9195d7887f8abb5c31ae9ec088f78a2626
2017-01-24 18:41:56 +08:00
Ting-Yu Lin
3cfff373f7 Bug 1333366 Part 1 - Update document related to Corner and HalfCorner. r=mats
MozReview-Commit-ID: 4wnjQOvploH

--HG--
extra : rebase_source : f300a44b190377e8217e5070f2d01261f54f5d22
2017-01-24 18:37:05 +08:00
Xidorn Quan
97d13f46a3 Bug 1303241 part 2 - Make GetVisitedDependentColor use style structs directly. r=dbaron
I think there are three advantages of this change:
1. removes some dependencies from layout / painting code to pre-computed
   value stuff in the style system;
2. makes it easier to audit usage of specific fields in style structs
   (which is probably a side effect of the first one);
3. potentially improves performance since it doesn't go through the
   unnecessary general logic in ExtractComputedValue.

Also, combined with the part before, we get a unified list for visited-
dependent properties so that we can ensure the assertion here and the
style difference calc code are consistent.

MozReview-Commit-ID: 5B9aN7CfRgI

--HG--
extra : rebase_source : ac80eaea2474b9ec4b47b1cc9a5bdd2e61f6ec4d
2016-12-31 00:57:37 +11:00
Phil Ringnalda
3f025b28e0 Merge m-c to m-i
MozReview-Commit-ID: 6JjpxZR3ese
2016-12-31 11:32:38 -08:00
Mats Palmgren
dfeed3a85d Bug 1325355 part 2 - Rename nsIFrame::GetWritingMode to WritingModeForLine to make its purpose clearer. r=jfkthame 2016-12-31 18:16:32 +01:00
Mats Palmgren
ea21a73fc7 Bug 1325355 part 1 - Make nsIFrame::GetWritingMode take a WritingMode param instead of calling this->GetWritingMode(). r=jfkthame 2016-12-31 18:16:32 +01:00
Xidorn Quan
0fe4f86e06 Bug 1322843 part 2 - Conditionally keep some floats in InlinePrefISizeData::ForceBreak. r=dbaron
This patch makes ForceBreak() partially clear floats according to the
break type of the coming block.

MozReview-Commit-ID: 71Gl9lBoTJ5

--HG--
extra : rebase_source : 5ca01565f607241df0c63a7cd64c35ac7ff7648f
2016-12-22 18:30:38 +11:00
Mats Palmgren
99856fc256 Bug 1312379 part 4 - Rename GetBaseline() to BaselineBOffset(). r=me 2016-12-20 23:56:35 +01:00
Mats Palmgren
ed15c70d6d Bug 1312379 part 1 - [css-align][css-flexbox][css-grid] Introduce nsIFrame methods for calculating baselines per CSS Alignment and CSS2 'vertical-align'. r=dholbert 2016-12-20 23:56:35 +01:00
Mats Palmgren
4050dea957 Bug 1313068 - [css-grid] Synthesize a grid container baseline from the margin-box when in an inline-level context, and from the border-box otherwise. r=dholbert 2016-12-20 23:56:34 +01:00
Julian Seward
2a625e574c Bug 1316556 - Remove zeroing allocation in class nsIPresShell. r=dbaron.
--HG--
extra : rebase_source : 203c4848cf0fe321b429c78ddf71acd662755e6d
2016-12-01 09:06:50 +01:00
L. David Baron
03d6962a30 Bug 1320815 - DeCOMtaminate nsIFrame::IsSelectable by returning boolean instead of nsresult. r=xidorn
MozReview-Commit-ID: EBxBcEgIvp7

--HG--
extra : rebase_source : 49e5a370df86baec014e99be56b05d451d5ee78c
2016-11-28 15:31:29 -08:00
L. David Baron
813fb8c039 Bug 1320815 - Make nsIFrame::IsSelectable non-virtual, and move implementation from nsFrame to nsIFrame. r=xidorn
MozReview-Commit-ID: HphEFug7EbQ

--HG--
extra : rebase_source : 86fe78f54940b1866ab737013658082799e09ef9
2016-11-28 15:31:29 -08:00
Ting-Yu Lin
7a0febcd1b Bug 1309467 Part 5 - Make flow area of <shape-box> values respect border-radius. r=dbaron
In GetFlowArea(), "Shrink our band's height if needed." computation was
moved to the end because we need to pass the unmodified |blockEnd| to
compute LineRight() and LineLeft().

Revamp OutsetBorderRadii() to allow negative margin to reduce the radius,
but not below zero. Also implement the cubic formula required by the spec.
https://drafts.csswg.org/css-shapes/#valdef-shape-box-margin-box

OutsetBorderRadii() is now tailored only for margin-box with border-radius,
so it might no longer be suitable for other scenarios.

MozReview-Commit-ID: HKxW7rp6sIA

--HG--
extra : rebase_source : d416433016304feefc9ed9dcd1c22f7f2f92e27e
2016-10-13 16:28:38 +08:00