mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
LayoutJS<T> implements Layout*Helpers instead of JS<T>.
This commit is contained in:
parent
a5d7240534
commit
e2bd9eadd8
8 changed files with 39 additions and 39 deletions
|
@ -15,7 +15,7 @@ use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLElementCast, HTMLInp
|
|||
use dom::bindings::codegen::InheritTypes::{HTMLInputElementDerived, HTMLFieldSetElementDerived, EventTargetCast};
|
||||
use dom::bindings::codegen::InheritTypes::KeyboardEventCast;
|
||||
use dom::bindings::global::GlobalRef;
|
||||
use dom::bindings::js::{Comparable, JS, JSRef, Root, Temporary, OptionalRootable};
|
||||
use dom::bindings::js::{Comparable, JSRef, LayoutJS, Root, Temporary, OptionalRootable};
|
||||
use dom::bindings::js::{ResultRootable, RootedReference, MutNullableJS};
|
||||
use dom::document::{Document, DocumentHelpers};
|
||||
use dom::element::{AttributeHandlers, Element};
|
||||
|
@ -140,15 +140,15 @@ pub trait RawLayoutHTMLInputElementHelpers {
|
|||
unsafe fn get_size_for_layout(&self) -> u32;
|
||||
}
|
||||
|
||||
impl LayoutHTMLInputElementHelpers for JS<HTMLInputElement> {
|
||||
impl LayoutHTMLInputElementHelpers for LayoutJS<HTMLInputElement> {
|
||||
#[allow(unrooted_must_root)]
|
||||
unsafe fn get_value_for_layout(self) -> String {
|
||||
unsafe fn get_raw_textinput_value(input: JS<HTMLInputElement>) -> String {
|
||||
unsafe fn get_raw_textinput_value(input: LayoutJS<HTMLInputElement>) -> String {
|
||||
(*input.unsafe_get()).textinput.borrow_for_layout().get_content()
|
||||
}
|
||||
|
||||
unsafe fn get_raw_attr_value(input: JS<HTMLInputElement>) -> Option<String> {
|
||||
let elem: JS<Element> = input.transmute_copy();
|
||||
unsafe fn get_raw_attr_value(input: LayoutJS<HTMLInputElement>) -> Option<String> {
|
||||
let elem: LayoutJS<Element> = input.transmute_copy();
|
||||
(*elem.unsafe_get()).get_attr_val_for_layout(&ns!(""), &atom!("value"))
|
||||
.map(|s| s.to_owned())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue