Commit Graph
197 Commits
Author SHA1 Message Date
Emilio Cobos Álvarez 44042b61d7 Bug 1552636 - Remove eStyleImageType_URL. r=TYLin
It was introduced in bug 1352096 to reduce complexity with Stylo (apparently).

Right now it doesn't look like it reduces any complexity, and it's a bit
annoying with some of the patches that I'm writing at the moment.

So unless there's any objection I think it should go away.

Differential Revision: https://phabricator.services.mozilla.com/D31708
2019-05-22 11:34:23 +00:00
Emilio Cobos Álvarez 95464eaeb7 Bug 1548691 - Use the owned slice type for basic shape polygon coordinates. r=TYLin,heycam
This enables destructors for tagged unions in cbindgen, implemented in:

 * https://github.com/eqrion/cbindgen/pull/333

Which allow us to properly generate a destructor for the cbindgen-generated
StyleBasicShape (which now contains an OwnedSlice).

For now, we still use the glue code to go from Box<BasicShape> to
UniquePtr<BasicShape>. But that will change in the future when we generate even
more stuff and remove all the glue.

I could add support for copy-constructor generation to cbindgen for tagged
enums, but I'm not sure if it'll end up being needed, and copy-constructing
unions in C++ is always very tricky.

Differential Revision: https://phabricator.services.mozilla.com/D29769
2019-05-09 11:24:57 +00:00
Emilio Cobos Álvarez 8ba05939c2 Bug 1546697 - Use a consistent style for enum classes in layout. r=dholbert
Per the discussion in:

  https://groups.google.com/d/msg/mozilla.dev.platform/P79pwa9z5m8/iPYPAWPHCAAJ

They should be CamelCase, and that's what most of them already do. This converts
the rest, which are a few.

For the ones that already used `e` or `k` prefixes, I've mostly done:

 for file in $(rg Type::e layout | cut -d : -f 1 | sort | uniq); do sed -i 's#Type::e#Type::#g' $file; done

For the ones that used uppercase, I've removed the prefix if it was already in
the type name, and turn them into CamelCase.

Depends on D28680

Differential Revision: https://phabricator.services.mozilla.com/D28681
2019-04-25 23:03:04 +00:00
Masayuki Nakano 394fc8aa9f Bug 1544343 - part 3: Make layout use mozilla::PresShell instead of nsIPresShell as far as possible r=emilio
This patch changes remaining things under `layout/`.  However, there are some
places which still need to use `nsIPresShell`.  That will be fixed in a
follow up bug.

Differential Revision: https://phabricator.services.mozilla.com/D27477
2019-04-16 07:25:10 +00:00
Cameron McCormack 25a8bde841 Bug 1534240 - Boost loading priority of CSS images similarly to how we do for HTML images. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D24814
2019-03-28 02:54:16 +00:00
Ryan Hunt a96492f0f6 Bug 1523969 part 14 - Move method definition inline comments to new line in 'layout/'. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D21115
2019-02-25 16:09:24 -06:00
Cameron McCormack 3c9d4e9a6c Bug 1511854 - Part 2: Fix some more formatting oddities in layout/ after the clang-format. r=TYLin
Depends on D13686

Differential Revision: https://phabricator.services.mozilla.com/D13775
2018-12-05 18:44:05 +00:00
Sylvestre Ledru e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Emilio Cobos Álvarez 9babd758f5 Bug 1504078 - Use references in the shapes code. r=bradwerth,TYLin
It doesn't make much sense to return const UniquePtr<Foo>& for something that
can't be null, it's just confusing.

Also make more stuff actually const.

Differential Revision: https://phabricator.services.mozilla.com/D10647
2018-11-02 18:19:06 +00:00
Boris Chiou aeb006d62c Bug 1429298 - Part 2: Define offset-path and implement it in style system. r=emilio
Define OffsetPath & SVGPathData on the servo-side, and StyleMotion &
StyleSVGPath on the gecko-side. We parse the SVG Path string into a
vector of PathCommand. To build the gfx::Path, we will convert it into
gfx::Path later in a different patch.

The basic flow is:
* Parse SVG Path String into SVGPathData (in Rust).
* Use cbindgen to make sure the layout of PathCommand and StylePathCommand,
  and then set the Box[PathCommand] into nsTArray<StylePathCommand>.
* Try to convert nsTArray<StylePathCommand> into gfx::Path. (This part
  will be implemented in a different patch.)

Finally, we use the gfx::Path to create a motion path transform.
The layout implementation is in the later patch.

Differential Revision: https://phabricator.services.mozilla.com/D2963
2018-08-21 22:41:38 -07:00
Emilio Cobos Álvarez ba82c4b179 Bug 1476054: Fixes and cleanups for Servo PR #21139. r=me
Logical floats don't appear in the computed style objects, so there's no need to
check for them.

MozReview-Commit-ID: 3ocJrRB3jeO
2018-07-17 10:15:46 +02:00
Gurzau Raul dcbcd177e8 Backed out 6 changesets (bug 1476054) for failing on servo/ports/geckolib/glue.rs on a CLOSED TREE
Backed out changeset f4941fe345ad (bug 1476054)
Backed out changeset cc571c618e4c (bug 1476054)
Backed out changeset 0a712d7bcb66 (bug 1476054)
Backed out changeset 62293a989ed2 (bug 1476054)
Backed out changeset ef2a43e3fc6c (bug 1476054)
Backed out changeset a2bb0089cf1d (bug 1476054)
2018-07-16 23:56:23 +03:00
Emilio Cobos Álvarez db60e73bd2 Bug 1476054: Fixes and cleanups for Servo PR #21139. r=me
Logical floats don't appear in the computed style objects, so there's no need to
check for them.

MozReview-Commit-ID: 3ocJrRB3jeO
2018-07-16 21:38:44 +02:00
Andi-Bogdan Postelnicu 569bc9b63e Bug 1453795 - Layout - Initialize member fields in classes/ structures. r=dbaron 2018-07-12 09:42:14 +03:00
Daniel Holbert 09e9cab68b Bug 1468663 part 2: Add missing #includes, forward-decls, and 'using' statements in layout/generic to fix bustage in non-unified builds. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D1650
2018-06-15 18:00:36 +00:00
Ting-Yu Lin 08c9219b17 Bug 1455453 - Coalesce calls to mFrame->StyleDisplay() in FloatInfo constructor. r=dholbert
MozReview-Commit-ID: 2tdsttkO6ig
2018-06-11 22:46:35 +08:00
Brad Werth bd11c1e59d Bug 1463745 Part 2: Change nsFlowAreaRect to also track whether it may widen in the block direction. r=dbaron
MozReview-Commit-ID: FWKQEFDBFgr
2018-05-30 11:07:18 -07:00
Brad Werth a3f9bc0e19 Bug 1463745 Part 1: Add methods to FloatInfo and ShapeInfo to report whether or not they could narrow in the block direction. r=dbaron
MozReview-Commit-ID: 38TMjcoaeAe
2018-05-30 10:03:45 -07:00
Brad Werth 054755dc45 Bug 1461046 Part 4: Change PolygonShapeInfo to tolerate polygons with only 1 or 2 vertices. r=dholbert
MozReview-Commit-ID: ICcIUulgSCW
2018-05-22 15:54:21 -07:00
Brad Werth 1b1c9b0f29 Bug 1461046 Part 3: Change RoundedBoxShapeInfo to tolerate empty rects. r=dholbert
MozReview-Commit-ID: FNQwXdeqfua
2018-05-18 17:38:41 -07:00
Brad Werth fb5e9ec1e1 Bug 1461046 Part 1: Change EllipseShapeInfo to tolerate empty circles/ellipses and treat them as singular points/lines (possibly expanded by shape-margin). r=dholbert
MozReview-Commit-ID: 69VQiRjhtqA
2018-05-18 17:13:22 -07:00
Gurzau Raul fe59adc10b Backed out 7 changesets (bug 1461046) for permafailing reftest on /reftests/css-invalid/select/select-disabled-fieldset-1.html a=backout
Backed out changeset f5990eb1eb0d (bug 1461046)
Backed out changeset 8e0c340b9700 (bug 1461046)
Backed out changeset fbfe1d5b94e1 (bug 1461046)
Backed out changeset 48057a6ba3d6 (bug 1461046)
Backed out changeset 5c8648bcf6bb (bug 1461046)
Backed out changeset 157bbc74460a (bug 1461046)
Backed out changeset e990d4d07b0e (bug 1461046)
2018-06-02 05:07:03 +03:00
Cosmin Sabou 0e09913ec6 Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-06-01 12:44:57 +03:00
Emilio Cobos Álvarez 4b8b5e1717 Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Brad Werth e74ffd5c1b Bug 1461046 Part 4: Change PolygonShapeInfo to tolerate polygons with only 1 or 2 vertices. r=dholbert
MozReview-Commit-ID: ICcIUulgSCW
2018-05-22 15:54:21 -07:00
Brad Werth efea470747 Bug 1461046 Part 3: Change RoundedBoxShapeInfo to tolerate empty rects. r=dholbert
MozReview-Commit-ID: FNQwXdeqfua
2018-05-18 17:38:41 -07:00
Brad Werth c5c2747778 Bug 1461046 Part 1: Change EllipseShapeInfo to tolerate empty circles/ellipses and treat them as singular points/lines (possibly expanded by shape-margin). r=dholbert
MozReview-Commit-ID: 69VQiRjhtqA
2018-05-18 17:13:22 -07:00
Brad Werth a925e8327a Bug 1464113 Part 1: Make ImageShapeInfo tolerate shapes that are shifted left or above their margin rects. r=dholbert
MozReview-Commit-ID: 9NuHsjQfLxP
2018-05-25 15:12:02 -07:00
Brad Werth 6bba34d1c2 Bug 1460041 Part 1: Correct PolygonShapeInfo constructor to measure its start and end block extents in margin rect space. r=jfkthame
MozReview-Commit-ID: 5pxiK1oH7sn
2018-05-08 15:56:49 -07:00
Coroiu Cristina 617c8a343b Backed out 2 changesets (bug 1460041) for lint failure at /builds/worker/checkouts/gecko/tools/lint/wpt.yml on a CLOSED TREE
Backed out changeset 25c0ace5ecb4 (bug 1460041)
Backed out changeset 8f13ab5de9be (bug 1460041)
2018-05-11 01:25:08 +03:00
Brad Werth 064c7d4cf5 Bug 1460041 Part 1: Correct PolygonShapeInfo constructor to measure its start and end block extents in margin rect space. r=jfkthame
MozReview-Commit-ID: 5pxiK1oH7sn
2018-05-08 15:56:49 -07:00
Coroiu Cristina 34300ac644 Backed out 2 changesets (bug 1460041) for linting failure at css/vendor-imports/mozilla/mozilla-central-reftests/shapes1 e.g. shape-outside-circle-056-ref.html on a CLOSED TREE
Backed out changeset b19f3977715c (bug 1460041)
Backed out changeset a1dbfe37baf3 (bug 1460041)
2018-05-10 20:15:58 +03:00
Brad Werth 4407595b6d Bug 1460041 Part 1: Correct PolygonShapeInfo constructor to measure its start and end block extents in margin rect space. r=jfkthame
MozReview-Commit-ID: 5pxiK1oH7sn
2018-05-08 15:56:49 -07:00
Brad Werth bbc7810622 Bug 1459697 Part 2: Account for the possibility that EllipseShapeInfo may not generate an interval for the entire BStart() to BEnd() range, due to rounding error in the distance field calculation. r=dbaron
MozReview-Commit-ID: CYeBKhDYD1F

The distance field does not calculate a true Euclidean distance, so it is
unreasonable to require that the intervals span all of the BStart() to BEnd()
float area. The final block pixel may not generate an interval at all due to
rounding errors. This change makes accomodation for the rounding errors and
adds asserts to ensure we aren't tolerating errors outside the area of the
last block pixel.
2018-05-07 14:02:03 -07:00
Brad Werth f7c06e2e67 Bug 1459697 Part 1: In EllipseShapeInfo distance field calculation, remove a warning that might trigger due to rounding error, and shorten the iteration of each block pixel row, when possible. r=dbaron
MozReview-Commit-ID: 6itpj3HBSRy
2018-05-08 11:11:47 -07:00
Brad Werth a9214478bb Bug 1457602 Part 2: Correct shape-outside: image interval creation to correctly handle sideways-lr (with or without positive shape-margin.) r=jfkthame
MozReview-Commit-ID: F4fsRPajJfR
2018-05-03 15:51:06 -07:00
Brad Werth 0125bd25b7 Bug 1457602 Part 1: Correct shape-outside: image shape-margin calculation for vertical writing modes. r=jfkthame
MozReview-Commit-ID: ChUL66vUkHu
2018-04-30 17:01:24 -07:00
Chris Peterson 5d6b16ea3b 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
2018-04-28 12:50:58 -07:00
Brad Werth 22329681a6 Bug 1451499 Part 3: Implement polygon for shape-margin > 0. r=jfkthame
MozReview-Commit-ID: BJtGaJBQMQr
2018-04-19 11:47:04 -07:00
Brad Werth 259a1af4cd Bug 1451499 Part 2: Stub in support for polygon with shape-margin == 0. r=jfkthame
MozReview-Commit-ID: 2biFnthoWin
2018-04-19 11:27:28 -07:00
Brad Werth 3ba6047dae Bug 1451499 Part 1: Uplift some interval methods from ImageShapeInfo to ShapeInfo. r=jfkthame
MozReview-Commit-ID: AMwujPuTeOm
2018-04-19 12:17:44 -07:00
Brad Werth 3103191e26 Bug 1457288 - Part 3: Change distance field sizes and indexes to be unsigned ints, avoiding undefined behavior with potential int overflows. r=mats 2018-04-30 12:25:13 -07:00
Brad Werth c40dba0ee4 Bug 1457288 - Part 2: Clamp shape-margin distance field operands to prevent int multiplication overflow when allocating. r=mats 2018-04-27 18:10:51 -07:00
Brad Werth 1aba681806 Bug 1457288 - Part 1: Clamp EllipseShapeInfo distance field operands to the maximum shape-margin we are willing to compute. r=mats
MozReview-Commit-ID: IXAV0uaxB0R
2018-04-27 13:10:08 -07:00
Brad Werth 2807283c13 Bug 1265342 Part 7: Implement shape-margin for shape-outside: shape-box. r=dholbert
MozReview-Commit-ID: 67vq9Gcr8qJ
2018-02-26 14:47:31 -08:00
Brad Werth 91c12e7873 Bug 1265342 Part 6b: Implement shape-margin for shape-outside: inset, for general case of shape-margin > 0. r=dholbert
MozReview-Commit-ID: 4pjALPSIBhI
2018-04-17 11:39:50 -07:00
Brad Werth cf7f6fcd0f Bug 1265342 Part 6a: Implement shape-margin for shape-outside: inset, for some special cases with shape-margin > 0. r=dholbert
MozReview-Commit-ID: AEOksiuM0GJ
2018-04-13 11:29:14 -07:00
Brad Werth 92f94f4546 Bug 1265342 Part 5d: Move EllipseShapeInfo class definition ahead of RoundedBoxShapeInfo so it can be referenced by rounded boxes. r=dholbert
MozReview-Commit-ID: G8qdPlnh8kY
2018-04-17 11:59:11 -07:00
Brad Werth 99177b8616 Bug 1265342 Part 5c: Add some asserts to ensure ellipse distance field index values are in-bounds. r=dholbert
MozReview-Commit-ID: CpuWWaLh1CX
2018-04-20 13:43:36 -07:00
Brad Werth 54e7c6fe32 Bug 1265342 Part 5b: Complete the implementation of shape-margin for ellipse (handling shape-margin: > 0). r=dholbert
MozReview-Commit-ID: CovCfk5ryEn
2018-04-11 15:18:32 -07:00