| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This trait is used to hold onto the downcast and upcast functions of all
castable IDL interfaces. A castable IDL interface is one which either derives
from or is derived by other interfaces.
The deriving relation is represented by implementations of marker trait
DerivedFrom<T: Castable> generated in InheritTypes.
/^[ ]*use dom::bindings::codegen::InheritTypes::.*(Base|Cast|Derived)/ {
/::[a-zA-Z]+(Base|Cast|Derived);/d
s/([{ ])[a-zA-Z]+(Base|Cast|Derived), /\1/g
s/([{ ])[a-zA-Z]+(Base|Cast|Derived), /\1/g
s/, [a-zA-Z]+(Base|Cast|Derived)([},])/\2/g
s/, [a-zA-Z]+(Base|Cast|Derived)([},])/\2/g
/\{([a-zA-Z]+(Base|Cast|Derived))?\};$/d
s/\{([a-zA-Z_]+)\};$/\1;/
}
s/([a-zA-Z]+)Cast::from_ref\(\&?\**([a-zA-Z_]+)(\.r\(\))?\)/\2.upcast::<\1>()/g
s/([a-zA-Z]+)Cast::from_ref\(\&?\**([a-zA-Z_]+)(\.[a-zA-Z_]+\(\))?\)/\2\3.upcast::<\1>()/g
s/\(([a-zA-Z]+)Cast::from_ref\)/\(Castable::upcast::<\1>\)/g
s/([a-zA-Z]+)Cast::from_root/Root::upcast::<\1>/g
s/([a-zA-Z]+)Cast::from_layout_js\(\&([a-zA-Z_.]+)\)/\2.upcast::<\1>()/g
s/([a-zA-Z]+)Cast::to_ref\(\&?\**([a-zA-Z_]+)(\.r\(\))?\)/\2.downcast::<\1>()/g
s/([a-zA-Z]+)Cast::to_ref\(\&?\**([a-zA-Z_]+)(\.[a-zA-Z_]+\(\))?\)/\2\3.downcast::<\1>()/g
s/\(([a-zA-Z]+)Cast::to_ref\)/\(Castable::downcast::<\1>\)/g
s/([a-zA-Z]+)Cast::to_root/Root::downcast::<\1>/g
s/([a-zA-Z]+)Cast::to_layout_js\(&?([a-zA-Z_.]+(\(\))?)\)/\2.downcast::<\1>()/g
s/\.is_document\(\)/.is::<Document>()/g
s/\.is_htmlanchorelement\(\)/.is::<HTMLAnchorElement>()/g
s/\.is_htmlappletelement\(\)/.is::<HTMLAppletElement>()/g
s/\.is_htmlareaelement\(\)/.is::<HTMLAreaElement>()/g
s/\.is_htmlbodyelement\(\)/.is::<HTMLBodyElement>()/g
s/\.is_htmlembedelement\(\)/.is::<HTMLEmbedElement>()/g
s/\.is_htmlfieldsetelement\(\)/.is::<HTMLFieldSetElement>()/g
s/\.is_htmlformelement\(\)/.is::<HTMLFormElement>()/g
s/\.is_htmlframesetelement\(\)/.is::<HTMLFrameSetElement>()/g
s/\.is_htmlhtmlelement\(\)/.is::<HTMLHtmlElement>()/g
s/\.is_htmlimageelement\(\)/.is::<HTMLImageElement>()/g
s/\.is_htmllegendelement\(\)/.is::<HTMLLegendElement>()/g
s/\.is_htmloptgroupelement\(\)/.is::<HTMLOptGroupElement>()/g
s/\.is_htmloptionelement\(\)/.is::<HTMLOptionElement>()/g
s/\.is_htmlscriptelement\(\)/.is::<HTMLScriptElement>()/g
s/\.is_htmltabledatacellelement\(\)/.is::<HTMLTableDataCellElement>()/g
s/\.is_htmltableheadercellelement\(\)/.is::<HTMLTableHeaderCellElement>()/g
s/\.is_htmltablerowelement\(\)/.is::<HTMLTableRowElement>()/g
s/\.is_htmltablesectionelement\(\)/.is::<HTMLTableSectionElement>()/g
s/\.is_htmltitleelement\(\)/.is::<HTMLTitleElement>()/g
|
|
|
|
|
|
|
| |
Given codegen now generates the various TypeId enums, it seems pointless to
still have to write their respective values in every DOM struct inheriting from
Node just to set the initial IS_IN_DOC flag in Document and IN_ENABLED_STATE in
form controls.
|
| |
|
| |
|
| |
|
|
|
|
| |
Fixes #7793.
|
| |
|
|
|
|
| |
This merges import blocks that were reported by tidy as unmerged.
|
|
|
|
|
|
|
| |
Some interfaces like Node, CharacterData and HTMLTableCellElement are never
instantiated directly, only their descendant interfaces are. Those are marked
with [Abstract] to set their type_id to None instead of having dummy values
in the TypeId enums.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that JSRef<T> is gone, there is no need to have helper traits.
On components/script/*.rs:
# Remove imports.
/^ *use dom::[a-z]+::\{.*Helpers/ {
s/\{(Raw[^L]|[^L][^a])[a-zA-Z]+Helpers, /\{/
s/, (Raw[^L]|[^L][^a])[a-zA-Z]+Helpers([,}])/\2/g
s/\{([a-zA-Z]+)\}/\1/
/\{\}/d
s/::self;$/;/
}
/^ *use dom::[a-z]+::\{?(Raw[^L]|[^L][^a])[a-zA-Z]+Helpers\}?;$/d
On components/script/dom/*.rs:
# Ignore layout things.
/^(pub )?(impl|trait).*Layout.* \{/,/^}$/ { P; D; }
# Delete helpers traits.
/^(pub )?trait ([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? \{$/,/^\}$/D
# Patch private helpers.
/^impl.*Private.*Helpers/,/^\}$/ {
s/^impl<'a> Private([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? for &'a ([^ ]+) \{$/impl \3 {/
/^ *(unsafe )?fn .*\(self.*[<&]'a/ {
s/&'a /\&/g
s/<'a, /</g
}
/^ *(unsafe )?fn /s/\(self([,)])/\(\&self\1/
}
# Patch public helpers.
/^impl.*Helpers/,/^\}$/ {
s/^impl(<'a>)? ([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? for (&'a )?([^ ]+) \{$/impl \5 {/
/^ *(unsafe )?fn .*\(self.*[<&]'a/ {
s/&'a /\&/g
s/<'a, /</g
}
/^ *(unsafe )?fn .*\(&?self[,)]/s/(unsafe )?fn/pub &/
/^ *pub (unsafe )?fn /s/\(self([,)])/\(\&self\1/
}
The few error cases were then fixed by hand.
|
|
|
|
| |
closes #7357
|
| |
|
|
|
|
| |
frame treese in script tasks.
|
|
|
|
|
|
|
| |
StrExt::slice_chars is deprecated and will be removed in Rust. This
lifts the implementation from Rust libstd and puts it in util::str.
This fixes a bunch of deprecation warnings in Servo.
|
|
|
|
|
|
| |
Do not copy the discarded node's text data, borrow it.
Closes #6658.
|
| |
|
|
|
|
| |
fixes #6524
|
| |
|
| |
|
|
|
|
|
|
|
| |
NodeTypeId is supposed to reflect the WebIDL inheritance hierarchy.
All of Text/ProcessingInstruction/Comment inherit from CharacterData,
which inherits from Node. There should be a CharacterDataTypeId value
that differentiates between those, instead.
|
| |
|
|\
| |
| |
| |
| |
| | |
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5721)
<!-- Reviewable:end -->
|
| | |
|
|/
|
|
|
|
|
|
|
|
| |
Extracted out of #5649
* add more hyperlinks to associated specification for structs/methods
* follow redirects and update links
* replace broken links
* removal of WHATWG multipage page name since the page name is not
guaranteed to be stable
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extracted this out of #5649
This commit was created with the following commands:
```
find . -iname "*.webidl" -type f -print0 | xargs -0 sed -i '' 's/http:\(.*\)whatwg.org/https:\1whatwg.org/g'
```
```
find . -iname "*.rs" -type f -print0 | xargs -0 sed -i '' 's/http:\(.*\)whatwg.org/https:\1whatwg.org/g'
```
|
| |
|
|
|
|
| |
It was not following the spec and it could panic.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
dom/nodes/Node-properties.html
detachedForeignComment.length]
detachedXmlComment.length]
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This used to conflict with the util crate from the standard library, which
has long since been removed.
The import in layout has not been changed because of a conflict with the
util mod there.
|
|
|
|
| |
into_string has been removed from Rust.
|
|\
| |
| |
| |
| |
| | |
Now `#[dom_struct]` also generates Reflectable impls, and there's another lint to ensure that a DOM struct only contains one bare DOM field (as the first field) or a Reflector.
A lot of this was generated by sed -- each autogenerated change has its own commit for easy review; these will be squashed later.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Obtained via:
`find . -maxdepth 1 -type f -print0 | xargs -0 sed -z -i "s/\\nimpl Reflectable for[^{]*{[^}]*}[^}]*}\\n//"`
`find . -maxdepth 1 -type f -print0 |xargs -0 grep -lZ dom_struct | xargs -0 grep -LZ "reflector()\\|Reflector::new" |xargs -0 sed -z -i "s/use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};/use dom::bindings::utils::reflect_dom_object;/"`
followed by semi-automated removal of leftover imports
|