Keith Yeung
c9193eaeca
Remove get_ prefix for functions in LayoutHTMLInputElementHelpers
2016-04-11 09:17:04 -04:00
Mauricio Collares
841aef06e0
Move CSS content property from Box to Counters
2016-04-05 00:21:47 -03:00
Emilio Cobos Álvarez
92f39ea5cf
Implement ::selection pseudo-element
2016-03-30 14:28:11 +02:00
Per Lundberg
4cb4cc93e4
Renamed TComputedValues to ComputedValues
...
This is a followup to #10210 , and a continuation of #10185 .
2016-03-29 23:30:13 +03:00
Per Lundberg
c2ad084713
ComputedValues is now ServoComputedValues
...
This is the first part of #10185 . More to follow. I have built this locally with both servo and geckolib without errors; let's see if it succeeds on all platforms as well.
2016-03-27 10:55:43 +03:00
bors-servo
bed91b3334
Auto merge of #10176 - mbrubeck:selection-range, r=pcwalton
...
Highlight selected text in input fields
Fixes #9993 . This does not yet allow stylesheets to set the selection colors; instead it uses a hard-coded orange background and white foreground.
r? @pcwalton
<!-- 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/10176 )
<!-- Reviewable:end -->
2016-03-26 08:16:20 +05:30
Matt Brubeck
6171000875
Highlight selected text in input fields
...
Fixes #9993 . This does not yet allow stylesheets to set the selection colors;
instead it uses a hard-coded orange background and white foreground.
2016-03-24 18:33:26 -07:00
Bobby Holley
c2daea2c9c
Parameterize the rest of the style system on TNode.
2016-03-24 11:50:57 -07:00
Michael Howell
9d9c5398a8
Get the fundamentals of the HTMLDetailsElement rendering stuff working.
...
Still need to implement the style invalidation.
Part of #9395
2016-03-19 16:02:11 -07:00
Bobby Holley
539f839958
Remove lifetimes from LayoutNode and friends.
2016-03-14 14:31:57 -07:00
Bobby Holley
b1878bd925
Remove lifetimes from T{Node,Element,Document}.
2016-03-14 14:31:57 -07:00
Matt Brubeck
973918967f
Dirty elements whose selectors are affected by sibling changes
...
This fixes incremental layout of nodes that match pseudo-class selectors such
as :first-child, :nth-child, :last-child, :first-of-type, etc.
* Fixes #8191
* Fixes #9063
* Fixes #9303
* Fixes #9448
This code is based on the following flags from Gecko:
https://hg.mozilla.org/mozilla-central/file/e1cf617a1f28/dom/base/nsINode.h#l134
2016-02-23 17:31:38 -08:00
Emilio Cobos Álvarez
61e04df266
style: Refactor the per_pseudo map from StyleData to avoid having an option value type.
...
This make the layout code way clearer.
2016-02-13 16:05:17 +01:00
Emilio Cobos Álvarez
dd503dfacb
Refactor style to be completely backend-independent
...
This commit refactors the style crate to be completely independent of
the actual implementation and pseudo-elements supported.
This also adds a gecko backend which introduces parsing for the
anonymous box pseudo-elements[1], although there's still no way of
querying them.
https://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSAnonBoxList.h
2016-02-13 16:05:14 +01:00
Emilio Cobos Álvarez
a1c830f1c1
Update rust-selectors
...
This commits updates rust-selectors to use the generic parser, and as
such it moves the element state into the style crate.
2016-02-03 02:11:31 +01:00
Simon Sapin
9abbd1b5d1
Sequentialize assign_block_size for flows that can be fragmented.
...
Fragmentation will be intertwined with block size calculation.
2016-01-28 09:42:17 +01:00
Simon Sapin
da2b4ab381
Disable incremental reflow for multicol and their descendants.
...
Fragmentation with dynamic updates is hard.
2016-01-27 17:33:12 +01:00
Bobby Holley
84f24a04a4
Basic wrappers and glue for GeckoLib.
2016-01-13 12:14:00 -08:00
Bobby Holley
77b1027646
Hoist style() and unstyle() into TNode.
2016-01-12 13:16:05 -08:00
bors-servo
099beee85c
Auto merge of #8983 - Manishearth:cursors, r=jdm
...
Various textinput fixes
- Currently the cursor sticks around if you click elsewhere. Now the text inputs are relayout-ed on blur.
- Currently whitespace gets collapsed in text input (https://github.com/servo/servo/issues/8772 ). Not anymore.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8983 )
<!-- Reviewable:end -->
2016-01-11 23:21:03 +05:30
rohan.prinja
1f02c4ebbb
task -> thread
2016-01-10 17:58:13 +09:00
Bobby Holley
ebc5eb1b98
Make parallel DOM traversal and style calculation operate on TNode instead of LayoutNode.
2016-01-06 17:58:53 -08:00
Bobby Holley
27987c3bb4
Introduce a concept of restyle damage to the style system.
...
We can't hoist RestyleDamage itself, because it's very layout-dependent. But this
should be enough to let us hoist the things we need.
2016-01-04 09:38:04 -08:00
Manish Goregaokar
23e7dfa57b
Relayout text input elements on blur
2016-01-03 13:18:24 +05:30
Johannes Linke
6b215f38ee
Fix a bunch of clippy lints
2016-01-02 23:27:15 +01:00
Bobby Holley
47059d2d26
Separate style+layout and layout-specific wrapper functionality.
...
This patch does a number of things, unfortunately all at once:
* Hoists a large subset of the layout wrapper functionality into the style system.
* Merges TElementAttributes into the newly-created TElement.
* Reorganizes LayoutData by style vs layout, and removes LayoutDataShared.
* Simplifies the API for borrowing style/layout data.
There's still more to do to make the style system usable standalone, but
this is a good start.
2015-12-29 11:50:03 -08:00
Bobby Holley
874545d8ca
Hoist more stuff from the concrete wrapper implementations into the trait definitions to allow sharing.
2015-12-23 12:05:25 -07:00
Bobby Holley
e55a56d757
Add an is_text_node to LayoutNode, so that we don't need to implement type_id for the style system.
2015-12-23 12:05:25 -07:00
Bobby Holley
6637626e02
Make DangerousThreadSafeLayoutNode public. :-(
...
I'm open to suggestions on how to do this better.
2015-12-23 12:05:25 -07:00
Simon Sapin
b19cc7e44c
Fix warnings
...
Fixing unused attributes warnings required updating serde_macros
which required updating to rustc 1.6.0-nightly (a2866e387 2015-11-30)
which required updating some other dependencies.
2015-12-03 17:05:26 +01:00
Bobby Holley
cf33f00018
Generalize the rest of layout to operate on generic Layout*.
...
There wasn't a good way to split this up, unfortunately.
With this change, the only remaining usage of the Servo-specific structures is
in layout_task, where the root node is received from the script task. \o/
2015-11-28 18:01:02 -08:00
Bobby Holley
3aeaff35de
Switch ChildrenIterator to be an associated type.
...
If we use ThreadsafeLayoutNodeChildrenIterator directly as the return type of children(),
we need to export the DangerousThreadSafeLayoutNode which the iterator implementation
relies upon.
2015-11-28 18:01:02 -08:00
Bobby Holley
2cfe4de09b
Constrain the ConcreteLayoutFoo associated types to provide full tri-ality among the types.
...
Otherwise we end up with this problem: http://is.gd/ACBLAU
2015-11-28 18:01:02 -08:00
Guillaume Gomez
adf8b359bb
Add XMLDocument object
2015-11-27 14:55:41 +01:00
Alan Jeffrey
3dec6edd10
Update string_cache to 0.2.
...
Updated string_cache, html5ever, xml5ever and selectors in Cargo.toml files and Cargo.lock.
Removed references to string_cache_plugin.
Import atom! and ns! from string_cache.
Replaced ns!("") by ns!().
Replaced ns!(XML) and co by ns!(xml) and co.
Replaced atom!(foo) by atom!("foo").
Replaced Atom::from_slice by Atom::from.
Replaced atom.as_slice() by &*atom.
2015-11-25 10:13:21 -06:00
bors-servo
711f516d80
Auto merge of #8639 - bholley:generalize_wrappers2, r=pcwalton
...
Use associated types for layout wrapper trait, and generalized ThreadSafeLayoutFoo
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8639 )
<!-- Reviewable:end -->
2015-11-24 04:01:32 +05:30
Bobby Holley
afa3834f3b
Rename ThreadSafeLayoutFoo to ServoThreadSafeLayoutFoo and TThreadSafeLayoutFoo to ThreadSafeLayoutFoo.
2015-11-21 11:26:49 -08:00
Bobby Holley
a85ae24c51
Hoist exported ThreadSafeLayoutFoo functionality into traits.
2015-11-21 11:25:20 -08:00
Bobby Holley
05db7b3652
Use associated types instead of wrapper types.
2015-11-21 10:18:02 -08:00
Bobby Holley
516619b230
Make the LayoutElement trait implement TElementAttributes.
2015-11-21 10:18:01 -08:00
Keith Yeung
7de7cb4786
Extend whitespace::T with additional helper methods
2015-11-20 11:05:36 -08:00
Bobby Holley
2f6e94943a
Rename Layout*Trait to Layout*.
...
The next step will be to remote the Servo-specificity of the layout code we want
to share by making it operate generically on Layout*.
2015-11-18 17:24:36 -08:00
Bobby Holley
9dd45b9f2a
Prefix concrete types with 'Servo'.
2015-11-18 17:23:46 -08:00
Bobby Holley
54f2700ba6
Hoist exported wrapper functionality into a family of traits.
...
All the existing code still uses the concrete implementations, so this
shouldn't impact the generated code at all.
2015-11-18 17:23:29 -08:00
Ms2ger
5ec1cdea9b
Remove dead code from layout.
2015-11-18 15:00:58 +01:00
Ms2ger
3fb16cc017
Privatize from_layout_js functions.
2015-11-17 09:40:51 +01:00
Ms2ger
9c1d678b1b
Remove get_unsigned_integer_attribute.
2015-11-15 11:24:03 +01:00
Ms2ger
5417df6397
Introduce a get_colspan method on LayoutJS<Element>.
2015-11-15 11:16:17 +01:00
Alan Jeffrey
84bde75b42
Replaced DOMString constructor by conversion functions.
...
Replaced DOMString(...) by DOMString::from(...).
Replaced ....0 by String::from(...).
Removed any uses of .to_owner() in DOMString::from("...").
2015-11-12 17:52:59 -06:00
Bobby Holley
b29369296c
Add ::from_layout_js factory to LayoutNode, LayoutElement, and LayoutDocument.
2015-11-10 11:57:25 -08:00