aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/display_list_builder.rs
Commit message (Collapse)AuthorAgeFilesLines
* Create own file for background calculations in layoutPyfisch2018-01-061-3803/+0
| | | | | | | | | | Move display_list_builder.rs and webrender_helpers.rs along with the new file to components/layout/display_list/ Remove apparently unused IdType enum. Only variant used was OverflowClip. See #19676
* Auto merge of #19699 - pyfisch:background-position-fix, r=emiliobors-servo2018-01-051-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Correctly place images with background-position: center Add a regression ref test. See also #19680. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19699) <!-- Reviewable:end -->
| * Correctly place images with background-position: centerPyfisch2018-01-051-1/+1
| | | | | | | | | | Add a regression ref test. See also #19680.
* | Remove mention of some old issuesPyfisch2018-01-041-2/+0
|/ | | | | | * #228 was done (confirmed by mbrubeck) * #2012 fixed TODO item * servo/webrender#28 (zoom does work)
* Format parts of layoutPyfisch2018-01-031-998/+1383
| | | | | | | | | | Formats the following files: * components/layout/display_list_builder.rs * components/layout/webrender_helpers.rs Remove outdated options from rustfmt.toml. Configure rustfmt to place binary operators at the end of line (to match ./mach test-tidy).
* Implement correct corner clipping for background colorPyfisch2018-01-031-15/+25
| | | | | | Add one regression ref test. See also #19649
* Auto merge of #19651 - pyfisch:background-placement, r=emiliobors-servo2018-01-021-256/+334
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unify background placement code Merges the implementations for background-image placement from gradients and images. Add missing parts and fix bugs. Now supported are the CSS properties: * background-attachment (except for local value, see #19650) * background-clip * background-origin * background-position-x/y * background-repeat * background-size It should be noted that backgrounds are not clipped to rounded border corners. (This was done before but worked only in simple cases) See: #19649 This solves the following issues: closes #19626 closes #16657 closes #19482 (examples from http://lea.verou.me/css3patterns/ are rendered perfectly but the round border is completely ignored now) closes #19577 - `./mach build -d` does not report any errors - `./mach test-tidy` does not report any errors I enabled a few tests with the first commit but I have written about a dozen manual tests I will try to turn into ref tests either before or after this patch lands. @bors-servo try The relationship between the different inputs is visualized in this flowchart: ![flowchart-background](https://user-images.githubusercontent.com/2781017/34394430-5a06c72c-eb59-11e7-9d51-3d23e2215f07.png) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19651) <!-- Reviewable:end -->
| * Test with fixes for background repeat: spacedPyfisch2018-01-021-54/+86
| | | | | | | | | | Test the interaction between background-repeat: spaced and CSS borders. Fix tile_image_axis() function.
| * Unify background placement codePyfisch2017-12-281-257/+303
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merges the implementations for background-image placement from gradients and images. Add missing parts and fix bugs. Now supported are the CSS properties: * background-attachment (except for local value) * background-clip * background-origin * background-position-x/y * background-repeat * background-size It should be noted that backgrounds are not clipped to rounded border corners.
* | Auto merge of #19652 - pyfisch:issue18435, r=emiliobors-servo2018-01-011-0/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix division by zero in gradient stop calculation Check if total_length is zero and return 0.0 instead of NaN in this case. Closes #18435 <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #18435 (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes OR - [x] These changes do not require tests because simple bugfix/no idea for good test <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19652) <!-- Reviewable:end -->
| * | Fix division by zero in gradient stop calculationPyfisch2017-12-281-0/+4
| |/ | | | | | | | | | | | | | | | | Check if total_length is zero and return 0.0 instead of NaN in this case. Closes #18435 Regression test for crash.
* / Remove solved FIXMEs about border radiiPyfisch2017-12-291-1/+0
|/
* Paint worklets: Implement timeout for worklet painter threadsYati Sagade2017-12-221-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a paint worklet thread takes too long, we would like to move on, since we have a ~16ms budget for rendering @60fps. At the moment, there is no provision in the paintworklet spec to signal such timeouts to the developer. ajeffrey opened an [issue][1] for this, but it got punted to v2 of the spec. Hence we are silently timing out unresponsive paint scripts. The timeout value is chosen to be 10ms by default, and can be overridden by setting the `dom.worklet.timeout_ms` pref. In the absence of such a timeout, the reftest in this commit would fail by timing out the testrunner itself, since the paint script never returns. From my discussions with ajeffrey, this should do until we spec out a way to signal timeouts to the script developer. Since we did not have a better way to trigger a timeout than a busy waiting loop (which would hog one core of the test machine until the timeout was reached), we decided to implement a test only blocking sleep, available to the PaintWorkletGlobalScope. Since `dom.worklet.enabled` enables worklets in general, we also decided to have another pref `dom.worklet.blockingsleep.enabled`, which, in addition to `dom.worklet.enabled`, would be required for the blocking sleep to be available. This fixes #17370. [1]: https://github.com/w3c/css-houdini-drafts/issues/507
* layout: background-origin attribute for gradientsPyfisch2017-12-151-10/+56
| | | | | Fixes the glitches mentioned in #19554. Now gradient tiles are placed in the whole bounding box.
* Auto merge of #19554 - pyfisch:tiled-gradients1, r=mbrubeckbors-servo2017-12-141-157/+163
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | layout: support tiled gradients Use background-size, background-position properties to render CSS gradients. Some cleanup in display_list_builder.rs related to gradient calculations. Adds two wpt tests for tiled gradients. Note: For now even gradients with background-repeat: no-repeat are repeated. Sometimes the gradient is not repeated everywhere. Resolves partially #19482. (See the mentioned website for example gradients with these features) See also: #16657 and #10412 Some glitches can be seen in the attached file. I am unsure what the exact intended semantics of [`push_gradient`](https://doc.servo.org/webrender_api/struct.DisplayListBuilder.html#method.push_gradient) are and want to ask the webrender team before building in "workarounds" for the missing gradients. ![half-rhombes](https://user-images.githubusercontent.com/2781017/33958051-b16f964a-e043-11e7-8218-b28388e2cf8d.png) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19554) <!-- Reviewable:end -->
| * layout: support tiled gradientsPyfisch2017-12-141-157/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use background-size, background-position properties to render CSS gradients. Some cleanup in display_list_builder.rs related to gradient calculations. Adds two wpt tests for tiled gradients. Note: For now even gradients with background-repeat: no-repeat are repeated. Sometimes the gradient is not repeated everywhere. Enable vars-background-shorthand-001.html CSS test.
* | style: Move outline-style outside of makoCYBAI2017-12-131-4/+4
|/
* style: Make all keywords CamelCase for consistency.Emilio Cobos Álvarez2017-12-061-37/+42
| | | | This prevents confusion and paves the ground for derive(Parse) of them.
* style: Implement css(dimension) and derive ToCss for a bunch of stuff.Emilio Cobos Álvarez2017-11-121-4/+4
| | | | For css(dimension), it'd be nice to derive(Parse) too, I think...
* Bump bitflags to 1.0 in every servo crateBastien Orivel2017-10-301-17/+20
|
* Update WR to use the new sticky positioning APIMartin Robinson2017-10-301-22/+27
|
* Auto merge of #19002 - emilio:kill-more-mako, r=jdmbors-servo2017-10-241-9/+10
|\ | | | | | | | | | | | | | | style: Move background-repeat and mask-repeat outside of mako. <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19002) <!-- Reviewable:end -->
| * style: Move background-repeat and mask-repeat outside of mako.Emilio Cobos Álvarez2017-10-241-9/+10
| |
* | Wait as late as possible to assign ClipIdsMartin Robinson2017-10-241-169/+169
|/ | | | | | | | | This will allow Servo to create ClipScrollNodes later during display list construction, which will be necessary once rounded rectangles are removed from the LocalClip structure. Instead of keeping track of the ClipId of each ClipScrollNode, we keep track of its index in an array of ClipScrollNodes. This will allow us to access them without a hash lookup.
* Auto merge of #18956 - glennw:update-wr-ellipse-bs, r=jdmbors-servo2017-10-201-5/+6
|\ | | | | | | | | | | | | | | Update WR (box shadows + per-corner radii, elliptical clips). <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18956) <!-- Reviewable:end -->
| * Update WR (box shadows + per-corner radii, elliptical clips).Glenn Watson2017-10-201-5/+6
| |
* | Backed out changeset e64e659c077d: servo PR #18809 and revendor for reftest ↵Gecko Backout2017-10-191-20/+17
|/ | | | | | failures, e.g. in layout/reftests/bugs/392435-1.html. r=backout on a CLOSED TREE Backs out https://github.com/servo/servo/pull/18809
* Update bitflags to 1.0 in every servo crateBastien Orivel2017-10-191-17/+20
| | | | | It still needs dependencies update to remove all the other bitflags versions.
* Auto merge of #18921 - mrobinson:incremental-stacking-context-ids, r=emiliobors-servo2017-10-181-13/+48
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix duplicate stacking context creation for anonymous Flows Anonymous nodes were previously creating duplicate stacking contexts, one for each node in the anonymous node chain. This change eliminates that for tables. Additionally the use of stacking context ids based on node addresses is no longer necessary since stacking contexts no longer control scrolling. This is the first step in eliminating the dependency between node addresses and ClipScrollNodes which causes issues like #16425. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because they are covered by existing tests. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18921) <!-- Reviewable:end -->
| * Fix duplicate stacking context creation for anonymous FlowsMartin Robinson2017-10-181-13/+48
| | | | | | | | | | | | | | | | | | | | | | Anonymous nodes were previously creating duplicate stacking contexts, one for each node in the anonymous node chain. This change eliminates that for tables. Additionally the use of stacking context ids based on node addresses is no longer necessary since stacking contexts no longer control scrolling. This is the first step in eliminating the dependency between node addresses and ClipScrollNodes which causes issues like #16425.
* | Fix commonmark Markdown warnings in docs, part 1Matt Brubeck2017-10-171-2/+2
|/ | | | | | | | Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is passed to rustdoc. This is mostly a global find-and-replace for bare URIs on lines by themselves in doc comments.
* Update WR (details below):Glenn Watson2017-10-161-4/+4
| | | | | | | | | | * Add support for clip masks on text runs. * Fix atomic ordering of items with multiple shadows. * Update to bincode + ipc-channel with optimizations. * Fix some plane splitting precision errors. * Improve the anti-aliasing quality significantly. * Add internal ClipChain support. * Fix diacritic glyphs on Linux.
* Remove usage of unstable feature box_patternsSimon Sapin2017-10-131-8/+23
|
* Remove usage of unstable box syntax, except in the script crateSimon Sapin2017-10-121-48/+49
| | | | | … because there’s a lot of it, and script still uses any other unstable features anyway.
* style: Remove the last of the explicit style fixups.Emilio Cobos Álvarez2017-10-011-46/+95
| | | | This one is particularly dumb, I think.
* Remove sources of panic when laying out an iframe without a nested browsing ↵Alan Jeffrey2017-09-221-2/+11
| | | | context.
* Auto merge of #17862 - asajeffrey:script-paint-worklet-border, r=pcwaltonbors-servo2017-09-181-96/+86
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented paint worklets drawing to a border. <!-- Please describe your changes on the following line: --> Allow paint worklets to draw to a border. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #17451. - [X] These changes do not require tests because the existing css-paint-api test check this (but annoyingly, all fail for other reasons) <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17862) <!-- Reviewable:end -->
| * Implemented paint worklets drawing to a border.Alan Jeffrey2017-08-091-96/+86
| |
* | Auto merge of #18506 - mrobinson:position-sticky-table, r=emiliobors-servo2017-09-181-19/+26
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix issues with the combination of position:sticky and tables <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #18441 (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18506) <!-- Reviewable:end -->
| * | Avoid creating multiple scroll roots for sticky tablesMateusz Naściszewski2017-09-151-0/+3
| | | | | | | | | | | | | | | This should prevent problems when a table has position:sticky and overflow:scroll.
| * | Fix panic when tables having position:stickyMartin Robinson2017-09-151-19/+23
| | | | | | | | | | | | | | | We no longer do any stacking context or clip node creation for table wrappers, instead relying on their TableFlows to do this.
* | | style: simplify -servo-text-decorations-in-effect.Emilio Cobos Álvarez2017-09-171-22/+25
| | | | | | | | | | | | | | | | | | It's stupid. Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
* | | Properly handle stacking context collection for truncated fragmentsMartin Robinson2017-09-151-23/+44
|/ / | | | | | | | | | | | | | | | | Before we did not properly descend intro truncated fragments when collecting stacking contexts. This change makes sure that we descend properly Fixes #18254. Fixes #17072.
* | Auto merge of #18462 - mrobinson:cleanup-building-state, r=emiliobors-servo2017-09-151-134/+185
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do some minor cleanups in display list building <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because they should not change behavior. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18462) <!-- Reviewable:end -->
| * | Rename ScrollRoot to ClipScrollNodeMartin Robinson2017-09-151-86/+87
| | | | | | | | | | | | | | | | | | ScrollRoot is an ever increasingly inaccurate name for this thing and WebRender consistently uses ClipScrollNode nowadays. Stick with the WebRender terminology to be consistent.
| * | Separate stacking context collection and display list building stateMartin Robinson2017-09-121-71/+121
| | | | | | | | | | | | | | | | | | | | | These are two different passes during layout, but previously they shared a state object. While some of the members are the same, many are different so we separate them out into two separate objects. We also change the HashMaps of these state objects to use the FnvHashMap.
* | | Use CSSPixelLength in LengthOrPercentage{*}.Boris Chiou2017-09-131-1/+1
| | | | | | | | | | | | | | | Replace Au with CSSPixelLength in LengthOrPercentage, LengthOrPercentageOrAuto, and LengthOrPercentageOrNone.
* | | Introduce CSSPixelLength and update NonNegativeLength.Boris Chiou2017-09-131-15/+19
|/ / | | | | | | | | | | | | | | | | | | | | First, we define computed::CSSPixelLength which contains a CSSFloat, a pixel value, and then we replace computed::Length with CSSPixelLength. Therefore, the |ComputedValue| of NoCalcLength, AbsoluteLength, FontRelativeLength, ViewportPercentageLength, CharacterWidth, and PhysicalLength is CSSPixelLength. Besides, we drop NonNegativeAu, and replace computed::NonNegativeLength with NonNegative<computed::Length>. (i.e. NonNegative<CSSPixelLength>)
* | Add support for position:stickyMartin Robinson2017-09-051-24/+127
| | | | | | | | | | | | | | | | This leverages the position:sticky support in WebRender to bring basic support for position:sticky in Servo. There are still some issues with nested sticky flows as well as a few other corner cases. Tests are imported from WPT and can be removed once we update to the latest version.
* | Allow overflow:scroll without a stacking contextMartin Robinson2017-08-241-23/+23
| | | | | | | | | | | | | | | | Fix the long-standing bug where items that are positioned and have overflow:scroll or overflow:auto automatically create stacking contexts. In order to do this we need to fix another bug where display list sorting can put a Clip or ScrollFrame definition after the first time it is used in a display list.