Commit graph

1698 commits

Author SHA1 Message Date
Ms2ger
0616a60fd9 Move ServoLayoutNode and related structs to script. 2016-06-20 19:08:05 +02:00
Ms2ger
0c726cfe6b Make RecalcStyleAndConstructFlows generic over the LayoutNode implementation. 2016-06-20 19:08:04 +02:00
Ms2ger
a8bb3d8d22 Make ServoLayoutNode::debug_id() less convoluted. 2016-06-20 19:08:03 +02:00
Ms2ger
7de3d165ad Introduce LayoutJS<Node>::opaque() to replace OpaqueNodeMethods::from_jsmanaged(). 2016-06-20 19:08:02 +02:00
Ms2ger
14a7e9bce1 Remove unused OpaqueNodeMethods::from_script_node. 2016-06-20 19:08:01 +02:00
Ms2ger
0d0b268138 Move LayoutNode and related traits to script_layout_interface. 2016-06-20 19:07:54 +02:00
Ms2ger
000e2de57a Move HTMLCanvasData to script_layout_interface. 2016-06-20 19:04:41 +02:00
Ms2ger
6b847eb93a Introduce LayoutNodeType and LayoutElementType enums. 2016-06-20 19:02:49 +02:00
Ms2ger
afc7118a67 Introduce a ThreadSafeLayoutNodeHelpers trait for methods to stay in layout. 2016-06-20 19:02:48 +02:00
Ms2ger
dac8878467 Introduce ThreadSafeLayoutNode::borrow_layout_data_unchecked. 2016-06-20 19:02:47 +02:00
Ms2ger
1039de8e7d Introduce a node_text_content method. 2016-06-20 19:02:46 +02:00
Ms2ger
16d6555f4d Move some more methods into the LayoutNodeLayoutData trait. 2016-06-20 19:02:45 +02:00
Ms2ger
c910ef2072 Introduce a LayoutNodeLayoutData trait for methods to stay in layout. 2016-06-20 19:02:44 +02:00
Ms2ger
310cb5a326 Introduce get_style_and_layout_data() methods. 2016-06-20 19:02:43 +02:00
Ms2ger
8b05833e52 Split initialize_data into two.
The first one handles the layout-specific part, and calls the second one to
handle the script-specific part.
2016-06-20 19:02:42 +02:00
Ms2ger
d50c166786 Use get_style_data() where possible. 2016-06-20 19:02:41 +02:00
Ms2ger
72632ac16d Implement get_style_data() methods. 2016-06-20 19:02:40 +02:00
Ms2ger
bea96f60e3 Introduce PartialStyleAndLayoutData. 2016-06-20 19:02:39 +02:00
Ms2ger
6aaf3e6a01 Move OpaqueStyleAndLayoutData to script_layout_interface. 2016-06-20 19:02:38 +02:00
Ms2ger
5c03dd8eb1 Introduce a script_layout_interface crate and move RestyleDamage to it. 2016-06-20 19:02:36 +02:00
bors-servo
c270622bfd Auto merge of #11800 - Ms2ger:place_float_if_applicable, r=nox
Remove unused argument to place_float_if_applicable.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11800)
<!-- Reviewable:end -->
2016-06-20 08:17:13 -05:00
bors-servo
881c02ec89 Auto merge of #11798 - notriddle:input_caret, r=nox
Account for the font of empty input fields

The font of empty fragments is not accounted for in layout. This behavior is incorrect when part of an input field.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #11653
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11798)
<!-- Reviewable:end -->
2016-06-20 05:58:23 -05:00
Ms2ger
2383cb2eee Remove unused argument to place_float_if_applicable. 2016-06-20 12:37:56 +02:00
Keith Yeung
d66a04ea6c Update string_cache to v0.2.20 2016-06-20 12:17:28 +08:00
Michael Howell
4717cea51c Account for the font of empty input fields
Fixes #11653
2016-06-19 13:06:06 -07:00
Michael Howell
b082dceebc Alignment is wrong. 2016-06-18 11:49:38 -07:00
ddh
5c7943217b Added DoubleEndedIterator for MutFlowListIterator 2016-06-17 14:57:41 +01:00
bors-servo
d2db39634e Auto merge of #11746 - DarinM223:master, r=mbrubeck
Image with height defined in % resizes properly

<!-- Please describe your changes on the following line: -->

Checked the html in the github issue and the image looks like it is resized properly in Servo.
Fixed image resizing when height is specified in percentages.
---
<!-- 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 #11723  (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because this issue is marked with has-test?

<!-- 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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11746)
<!-- Reviewable:end -->
2016-06-16 03:57:38 -05:00
Maciej Skrzypkowski
27b05c58f6 Small performance improvement
node.selection() is not used text_content is equal to 
TextContent::GeneratedContent(content_items)
2016-06-16 08:58:03 +02:00
Darin Minamoto
4a4be1d7e5 Image with height defined in % resizes properly 2016-06-15 16:39:22 -07:00
Ms2ger
e723d72570 Move the initialize_data method out of the TNode trait.
This reduces the dependency of TNode implementations on layout types.
2016-06-13 15:21:29 +01:00
Ms2ger
ae5cb0ceb0 Move the TNode::initialize_data() call from recalc_style_at to its callers.
This will allow us to make it an inherent method.
2016-06-13 15:11:21 +01:00
Ms2ger
172aa226cc Use Ref/RefMut::map rather than transmute for ServoLayoutNode. 2016-06-13 12:29:14 +01:00
mrmiywj
46cadfdd2c use less repetitive name 2016-06-12 12:28:07 +08:00
Patrick Walton
041cfe6d0a script: When using WebRender, keep the DOM-side scroll positions for
elements with `overflow: scroll` up to date, and take them into account
when doing hit testing.

Closes #11648.
2016-06-10 18:43:04 -07:00
Anthony Ramine
b97c7a8c4d Don't load all font faces sources
We stop at the first one we manage to load.
2016-06-10 21:51:06 +02:00
bors-servo
1e3edf3ca4 Auto merge of #11656 - Ms2ger:reduce-dom-exposure, r=nox
Reduce the amount of dom code used outside the script crate.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11656)
<!-- Reviewable:end -->
2016-06-07 11:09:14 -05:00
Ms2ger
6a1722e18d Make layout only depend on script::layout_interface. 2016-06-07 13:46:49 +02:00
Ms2ger
684510bc94 Stop re-exporting AttrValue. 2016-06-07 13:15:23 +02:00
Ms2ger
858ea2eb9a Move the definition of ServoThreadSafeLayoutNode::iframe_pipeline_id to script. 2016-06-07 11:39:28 +02:00
Ms2ger
5859109197 Move the definition of ServoThreadSafeLayoutNode::canvas_data to script. 2016-06-07 11:10:40 +02:00
Ms2ger
ef3c6a7773 Move the definition of ServoThreadSafeLayoutNode::image_url to script. 2016-06-07 10:57:20 +02:00
bors-servo
b64b21ace0 Auto merge of #11565 - nox:fonts, r=metajack
Introduce FontFaceRules::effective_sources()

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11565)
<!-- Reviewable:end -->
2016-06-07 03:50:18 -05:00
Ms2ger
093b7b7710 Move the definition of ServoThreadSafeLayoutNode::selection to script. 2016-06-07 10:30:52 +02:00
bors-servo
0f1f99a4bf Auto merge of #11572 - nox:placeholder-shown, r=SimonSapin
Implement :placeholder-shown (fixes #10561)

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11572)
<!-- Reviewable:end -->
2016-06-06 23:44:16 -05:00
Anthony Ramine
64b34d5162 Introduce FontFaceRules::effective_sources()
This avoids downloading fonts in formats we don't support.
2016-06-06 23:43:09 +02:00
Ms2ger
206d603f53 Correct the signature of flow_ref::deref_mut.
This also fixes Undefined Behavior in build_display_list_for_subtree.
2016-06-06 15:14:23 +02:00
bors-servo
5002dff853 Auto merge of #11442 - mitchhentges:87-debug-id, r=KiChjang
Fragment debug_id u16 only exists in debug, prod will format mem address

<!-- Please describe your changes on the following line: -->
Each fragment has a `u16` `debug_id` in debug mode, but no `debug_id` in production to save memory. To format a debug id in production, the address of the empty `debug_id` is displayed.

---
<!-- 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 #87 (github issue number if applicable).

<!-- Either: -->
- [X] These changes do not require tests because it looks like it's not possible to mock out `cfg` options in `#[test]`s

<!-- 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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11442)
<!-- Reviewable:end -->
2016-06-04 16:03:59 -05:00
Mitchell Hentges
43396c027d Fragment debug_id u16 only exists in debug, prod will format mem address 2016-06-04 19:19:42 +02:00
Ms2ger
021b9e3239 Remove the layout shutdown channel.
Nobody is listening.
2016-06-04 13:24:32 +02:00