Commit Graph

13249 Commits

Author SHA1 Message Date
Ting-Yu Lin
5ebb40fc4c Bug 1311244 Part 6 - Add ShapeInfo and move <shape-box> impl to BoxShapeInfo. r=dbaron
Create ShapeInfo as a base class for implementing all the shapes. In this
design, we only need to create the correct subclass in FloatInfo's
constructor whenever shape-outside is used rather than manually branching on
StyleShapeSourceType and StyleBasicShape in all the methods like
LineRight(), LineLeft(), etc.

The concrete subclass of ShapeInfo could focus on implementing how its shape
influence the flow area by overriding the needed methods in ShapeInfo.

Move ComputeEllipseLineInterceptDiff() and XInterceptAtY() under the scope
of ShapeInfo so that they could be used by BoxShapeInfo and all the other
ShpapeInfo subclasses yet to come.

MozReview-Commit-ID: ETVc5FdGNha

--HG--
extra : rebase_source : 9a083ccd95fd7565112a45e30c15a91b97c7290f
2017-01-06 16:36:30 +08:00
Ting-Yu Lin
73e06aacdd Bug 1311244 Part 5 - Convert FloatInfo's copy constructor into a move constructor. r=dbaron
Use move constructor for two reasons. 1) The copy constructor is needed only
when appending FloatInfo to mFloats, so using move constructor will likely
be more efficient if some of the member variables support move constructor.
2) Part 6 will added a UniquePtr member to FloatInfo, so using move
constructor becomes necessary.

Also change the return value of AddFloat() to void to simplify the code,
since all the other callers do not check the return value, and
BlockReflowInput::FloatAndPlaceFloat() only asserts in debug mode. I assume
it's safe to omit the OOM check.

MozReview-Commit-ID: GVbbsdBjr7b

--HG--
extra : rebase_source : e0f647e029278a5033bb9d6d780e73e32de460d3
2017-01-06 16:36:19 +08:00
Carsten "Tomcat" Book
b80159cfa9 Backed out changeset 60d8d64ca347 (bug 1311244) 2017-01-12 14:19:22 +01:00
Carsten "Tomcat" Book
ce67e53a4d Backed out changeset 2893ecc79fef (bug 1311244) 2017-01-12 14:19:20 +01:00
Carsten "Tomcat" Book
6cbcd637ab Backed out changeset 466053d9302b (bug 1311244) 2017-01-12 14:19:18 +01:00
Ting-Yu Lin
703d48f356 Bug 1311244 Part 7 - Implement shape-outside: circle(). r=dbaron
circle() allows the user to define an empty flow area, so IsEmpty() needs to
be overridden.

The flow area defined by a shape needs to be clipped to the margin-box per
https://drafts.csswg.org/css-shapes/#relation-to-box-model-and-float-behavior

In the reftests, both clip-path and shape-outside uses the same value so
that it's easier to debug visually.

Add LogicalPoint::LineRelative() because we need to convert a point's I() to
the line-axis in nsFloatManager. LineRelative() differs from I() in all
'rtl' direction per
https://drafts.csswg.org/css-writing-modes-3/#logical-to-physical

MozReview-Commit-ID: FxQaFPrEQ73

--HG--
extra : rebase_source : 0d768002a38adbded2a0caa6d3e001eaaca3313d
2017-01-06 16:36:43 +08:00
Ting-Yu Lin
7696a7581c Bug 1311244 Part 6 - Add ShapeInfo and move <shape-box> impl to BoxShapeInfo. r=dbaron
Create ShapeInfo as a base class for implementing all the shapes. In this
design, we only need to create the correct subclass in FloatInfo's
constructor whenever shape-outside is used rather than manually branching on
StyleShapeSourceType and StyleBasicShape in all the methods like
LineRight(), LineLeft(), etc.

The concrete subclass of ShapeInfo could focus on implementing how its shape
influence the flow area by overriding the needed methods in ShapeInfo.

Move ComputeEllipseLineInterceptDiff() and XInterceptAtY() under the scope
of ShapeInfo so that they could be used by BoxShapeInfo and all the other
ShpapeInfo subclasses yet to come.

MozReview-Commit-ID: ETVc5FdGNha

--HG--
extra : rebase_source : 9a083ccd95fd7565112a45e30c15a91b97c7290f
2017-01-06 16:36:30 +08:00
Ting-Yu Lin
ea61e604fa Bug 1311244 Part 5 - Convert FloatInfo's copy constructor into a move constructor. r=dbaron
Use move constructor for two reasons. 1) The copy constructor is needed only
when appending FloatInfo to mFloats, so using move constructor will likely
be more efficient if some of the member variables support move constructor.
2) Part 6 will added a UniquePtr member to FloatInfo, so using move
constructor becomes necessary.

Also change the return value of AddFloat() to void to simplify the code,
since all the other callers do not check the return value, and
BlockReflowInput::FloatAndPlaceFloat() only asserts in debug mode. I assume
it's safe to omit the OOM check.

MozReview-Commit-ID: GVbbsdBjr7b

--HG--
extra : rebase_source : e0f647e029278a5033bb9d6d780e73e32de460d3
2017-01-06 16:36:19 +08:00
Carsten "Tomcat" Book
3ad97e202a merge mozilla-inbound to mozilla-central a=merge 2017-01-12 10:14:43 +01:00
Cameron McCormack
1251ea98d8 Bug 1324663 - stylo: Adjust one more assertion annotation. r=me
MozReview-Commit-ID: 3tHwZtuUWwG
2017-01-12 11:57:52 +08:00
Jeremy Chen
6d7e1d5777 Bug 1316482 - use the refactored TransformText as a template function for both char16_t and uint8_t text. r=xidorn
With this patch, we shall only maintain one version of the TransformText logic.

MozReview-Commit-ID: JAIksFVqvqf

--HG--
extra : rebase_source : 3187632d7162bba64994b793448314b8323e3d46
2017-01-12 09:27:02 +08:00
Jeremy Chen
526327d9d5 Bug 1316482 - remove collapsible white spaces according to the White Space Processing Rules. r=jfkthame
This patch is an implementation of CSS Text 3 - 4.1.1 Phase 1 Step 1.

According to the specification, if white space characters are considered
collapsible, they should be removed before applying segment break transformation
rules during the text transform.

In this patch, a refactoring of text transformation logic has been made. Every
run of consecutive document white space characters (spaces/tabs/segment breaks)
is collected first. Then, we could apply the white space processing rules
accordingly.

MozReview-Commit-ID: 1JStjFk5TBs

--HG--
extra : rebase_source : b7a81e08c026d25482dc35994f4595989c8b09c0
2017-01-12 09:27:01 +08:00
Mats Palmgren
47b455e007 Bug 1328030 - Improve selecting content that contains elements with anonymous content (form controls etc). r=smaug
Two changes:
In nsIFrame::GetFrameFromDirection, detect frames that are in
a different anonynous content tree than 'this' and then just keep
traversing frames until we get one that isn't.

In nsFrame::GetLastLeaf: the old code did allow the first child frame
to be IsRootOfNativeAnonymousSubtree (it just checked siblings).
I think this was unintentional and that we should check the first
child too (and return its parent in that case, i.e. never return
something that is IsRootOfNativeAnonymousSubtree here).
2017-01-11 16:57:27 +01:00
Cameron McCormack
9f99f387ac Bug 1324663 - stylo: Adjust expectations now that we've disabled style context tree structure assertions. r=me
MozReview-Commit-ID: EORVNMWW7gu
2017-01-11 20:35:12 +08:00
Emilio Cobos Álvarez
59cba95f7f (no bug) Drive-by ReflowInput whitespace fixup. r=dholbert
DONTBUILD because whitespace-only

MozReview-Commit-ID: GRIdsfVYsqD
2017-01-10 18:55:42 -08:00
Wes Kocher
b0c1453d57 Backed out 4 changesets (bug 1316482) for frequent reftest failures on win7vm a=backout
Backed out changeset ad208e73ab6c (bug 1316482)
Backed out changeset 2a28dc0a75d3 (bug 1316482)
Backed out changeset b54126cc63d4 (bug 1316482)
Backed out changeset ebd0c6c8b783 (bug 1316482)

MozReview-Commit-ID: IFpLJUjj8qH
2017-01-10 18:11:10 -08:00
Carsten "Tomcat" Book
89882dc5f4 merge mozilla-inbound to mozilla-central a=merge 2017-01-10 12:11:31 +01:00
Kartikaya Gupta
9e559d6077 Bug 1327095 - Shift the rootCompBounds to maximize overlap with the displayportBase before intersecting. r=tnikkel
MozReview-Commit-ID: JI6avscMLs5
2017-01-09 21:46:56 -05:00
Wes Kocher
105aea2522 Merge m-c to inbound a=merge
MozReview-Commit-ID: G24aq5fbYNd
2017-01-09 16:44:58 -08:00
Cameron McCormack
466ecf05e1 Bug 1324705 - stylo: Update some crashtest assertion expectations. r=emilio
These were fixed by https://github.com/servo/servo/pull/14922.

MozReview-Commit-ID: 3Ypfq0BmkIY

--HG--
extra : rebase_source : c32e69303826b65059dcae963ddce94f5f4c40f8
2017-01-09 17:34:16 +08:00
Cameron McCormack
3bd4794eaf Bug 1324673 - stylo: Update some crashtest assertion expectations. r=emilio
These were fixed by https://github.com/servo/servo/pull/14922.

MozReview-Commit-ID: H7s2lGJ8QYU

--HG--
extra : rebase_source : ef104630c7715f2f95539a3bb65e46a480ff2bdb
2017-01-09 17:34:18 +08:00
Jeremy Chen
f53d660a40 Bug 1316482 - use the refactored TransformText as a template function for both char16_t and uint8_t text. r=xidorn
With this patch, we shall only maintain one version of the TransformText logic.

MozReview-Commit-ID: JAIksFVqvqf

--HG--
extra : rebase_source : 49ec749ae74f872e9749e026affe7f2e22db71f9
2017-01-10 00:02:03 +08:00
Jeremy Chen
498b737c47 Bug 1316482 - remove collapsible white spaces according to the White Space Processing Rules. r=jfkthame
This patch is an implementation of CSS Text 3 - 4.1.1 Phase 1 Step 1.

According to the specification, if white space characters are considered
collapsible, they should be removed before applying segment break transformation
rules during the text transform.

In this patch, a refactoring of text transformation logic has been made. Every
run of consecutive document white space characters (spaces/tabs/segment breaks)
is collected first. Then, we could apply the white space processing rules
accordingly.

MozReview-Commit-ID: 1JStjFk5TBs

--HG--
extra : rebase_source : 0c3cd845f12de407558aae4db3f3c75343da7050
2017-01-10 00:02:02 +08:00
Kartikaya Gupta
bd279ccabc Bug 1329663 - Move code from ScrollFrameHelper's destructor the Destroy() function. r=tnikkel
MozReview-Commit-ID: 1OWCCvR6X2N
2017-01-09 17:21:44 -05:00
Phil Ringnalda
a52a0f5571 Backed out 8 changesets (bug 1311244) for OOM failures in Win7 debug R1
Backed out changeset d5411799a28f (bug 1311244)
Backed out changeset ff9c71e1dbc8 (bug 1311244)
Backed out changeset 96988ec5b81c (bug 1311244)
Backed out changeset 9d257713833a (bug 1311244)
Backed out changeset 2c33905ccb04 (bug 1311244)
Backed out changeset 20148e33d523 (bug 1311244)
Backed out changeset f36cd1532fdb (bug 1311244)
Backed out changeset 2ee4ea83a6b4 (bug 1311244)
2017-01-08 21:11:25 -08:00
Ting-Yu Lin
54c22b733c Bug 1311244 Part 7 - Implement shape-outside: circle(). r=dbaron
circle() allows the user to define an empty flow area, so IsEmpty() needs to
be overridden.

The flow area defined by a shape needs to be clipped to the margin-box per
https://drafts.csswg.org/css-shapes/#relation-to-box-model-and-float-behavior

In the reftests, both clip-path and shape-outside uses the same value so
that it's easier to debug visually.

Add LogicalPoint::LineRelative() because we need to convert a point's I() to
the line-axis in nsFloatManager. LineRelative() differs from I() in all
'rtl' direction per
https://drafts.csswg.org/css-writing-modes-3/#logical-to-physical

MozReview-Commit-ID: FxQaFPrEQ73

--HG--
extra : rebase_source : 02b4eafdff42477ef2c69d604a1650db01f954e4
2017-01-06 16:36:43 +08:00
Ting-Yu Lin
af28dce861 Bug 1311244 Part 6 - Add ShapeInfo and move <shape-box> impl to BoxShapeInfo. r=dbaron
Create ShapeInfo as a base class for implementing all the shapes. In this
design, we only need to create the correct subclass in FloatInfo's
constructor whenever shape-outside is used rather than manually branching on
StyleShapeSourceType and StyleBasicShape in all the methods like
LineRight(), LineLeft(), etc.

The concrete subclass of ShapeInfo could focus on implementing how its shape
influence the flow area by overriding the needed methods in ShapeInfo.

Move ComputeEllipseLineInterceptDiff() and XInterceptAtY() under the scope
nsFloatManager so that they could be used by BoxShapeInfo and all the other
ShpapeInfo subclasses yet to come.

MozReview-Commit-ID: ETVc5FdGNha

--HG--
extra : rebase_source : c73b0d0be2350db3eedb61b565de194842352ba1
2017-01-06 16:36:30 +08:00
Ting-Yu Lin
6dbe03d519 Bug 1311244 Part 5 - Convert FloatInfo's copy constructor into a move constructor. r=dbaron
Use move constructor for two reasons. 1) The copy constructor is needed only
when appending FloatInfo to mFloats, so using move constructor will likely
be more efficient if some of the member variables support move constructor.
2) Part 6 will added a UniquePtr member to FloatInfo, so using move
constructor becomes necessary.

Also change the return value of AddFloat() to void to simplify the code,
since all the other callers do not check the return value, and
BlockReflowInput::FloatAndPlaceFloat() only asserts in debug mode. I assume
it's safe to omit the OOM check.

MozReview-Commit-ID: GVbbsdBjr7b

--HG--
extra : rebase_source : 4765bbcf5c2533845bd8f7fb00117983429a622e
2017-01-06 16:36:19 +08:00
Jonathan Watt
9bf8dd0b49 Bug 1328275 - Refactor and comment nsSimplePageSequenceFrame::PrintNextPage to make it easier to understand. r=bobowen 2016-12-28 11:26:31 +00:00
Cameron McCormack
d4de4e55a0 Bug 1324624 - stylo: More crashtest assertion adjustments.
MozReview-Commit-ID: DM8nLXSiSxr
2017-01-07 16:33:50 +08:00
Iris Hsiao
f035ae5a9d Merge mozilla-central to mozilla-inbound 2017-01-06 11:10:58 -05:00
Iris Hsiao
7adb57a57f merge autoland to mozilla-central a=merge 2017-01-06 11:06:17 -05:00
Ting-Yu Lin
53633b1c42 Bug 1320014 Part 14 - Convert NS_SIDE_TO_HALF_CORNER to a constexpr function. r=mats
MozReview-Commit-ID: 4MQu8omCdcg

--HG--
extra : rebase_source : 0bce3eb380c2bacd5a4576e1a57c96afb8b57160
2017-01-05 16:23:16 +08:00
Ting-Yu Lin
78cc3f541d Bug 1320014 Part 12 - Convert NS_SIDE_IS_VERTICAL to a constexpr function. r=mats
MozReview-Commit-ID: GFdigJKppuR

--HG--
extra : rebase_source : d3a66d22d99d2988d5c3c44bc1da51e30efa8d1a
2017-01-05 16:07:02 +08:00
Ting-Yu Lin
229d433359 Bug 1320014 Part 9 - Convert NS_HALF_CORNER_IS_X to a constexpr function. r=mats
MozReview-Commit-ID: 3d2opSIjAUc

--HG--
extra : rebase_source : 03e55f0458dd305fa782ca1e46c32069045e86e9
2017-01-05 14:30:14 +08:00
Ting-Yu Lin
797609894a Bug 1320014 Part 7 - Convert half corner indices #define to an enum. r=mats
MozReview-Commit-ID: 8lNtjV14WTN

--HG--
extra : rebase_source : dbfa992a2ee3cab2f639fb5a68463a673410ade6
2017-01-05 11:31:38 +08:00
Nathan Froyd
f6a73ed989 Bug 1315274 - rename mozilla::MakeRange to mozilla::IntegerRange; r=Waldo
MakeRange is just way too generic for this sort of thing.
2017-01-06 09:22:53 -05:00
Wes Kocher
0f254a30d6 Merge inbound to central, a=merge
MozReview-Commit-ID: 1ij6nLf8f8s
2017-01-05 17:30:35 -08:00
Phil Ringnalda
d105fd40fd Merge m-c to autoland 2017-01-04 19:01:49 -08:00
Phil Ringnalda
c83d1d7ce9 Merge m-i to m-c, a=merge
MozReview-Commit-ID: 51FMtH1yTe6
2017-01-04 18:33:32 -08:00
Boris Zbarsky
99d2e96def Bug 1298588 part 9, gecko piece. Pass through useful default styles to cascade(). r=bholley 2017-01-04 14:52:27 -05: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
Olli Pettay
0364dbc792 Bug 1326507, remove NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS, r=mccr8
--HG--
extra : rebase_source : 3ae1207308de120b7299b13ecaa95dd1612b3459
2017-01-03 21:47:55 +02:00
Mats Palmgren
4cb897b943 Bug 1232194 part 2 - [writing-mode] Make ConsumedBSize() return the block-axis size, not the physical height. r=dholbert 2017-01-04 00:56:19 +01:00
Mats Palmgren
10150aa1b7 Bug 1232194 part 1 - [writing-mode] Drop "Get" from GetConsumedBSize() and add a WritingMode param. r=dholbert 2017-01-04 00:56:19 +01:00
Cameron McCormack
61569b57a1 Bug 1324624 - Tweak stylo crashtest assertion annotations a bit more.
MozReview-Commit-ID: D2AntG68VGr
2017-01-02 16:25:22 +08:00
Phil Ringnalda
8ffd5762b5 Merge m-i to m-c, a=merge
MozReview-Commit-ID: L58yTXbUD21
2017-01-01 11:17:06 -08: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