mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Move get_attr and get_attrs into TElementAttributes.
These methods are only called on LayoutElement.
This commit is contained in:
parent
2ff18b6b95
commit
34e35df986
9 changed files with 36 additions and 45 deletions
|
@ -40,7 +40,7 @@ use string_cache::Atom;
|
|||
use style::computed_values::content::ContentItem;
|
||||
use style::computed_values::{border_collapse, clear, mix_blend_mode, overflow_wrap, position};
|
||||
use style::computed_values::{text_align, text_decoration, white_space, word_break};
|
||||
use style::node::{TElement, TNode};
|
||||
use style::node::TNode;
|
||||
use style::properties::{self, ComputedValues, cascade_anonymous};
|
||||
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto};
|
||||
use style::values::computed::{LengthOrPercentageOrNone};
|
||||
|
|
|
@ -536,18 +536,6 @@ impl<'le> TElement<'le> for LayoutElement<'le> {
|
|||
self.element.namespace()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn get_attr(self, namespace: &Namespace, name: &Atom) -> Option<&'le str> {
|
||||
unsafe { self.element.get_attr_val_for_layout(namespace, name) }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn get_attrs(self, name: &Atom) -> Vec<&'le str> {
|
||||
unsafe {
|
||||
self.element.get_attr_vals_for_layout(name)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_link(self) -> Option<&'le str> {
|
||||
// FIXME: This is HTML only.
|
||||
let node: &Node = NodeCast::from_actual(self.element);
|
||||
|
@ -650,7 +638,7 @@ impl<'le> TElement<'le> for LayoutElement<'le> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'le> TElementAttributes for LayoutElement<'le> {
|
||||
impl<'le> TElementAttributes<'le> for LayoutElement<'le> {
|
||||
fn synthesize_presentational_hints_for_legacy_attributes<V>(self, hints: &mut V)
|
||||
where V: VecLike<DeclarationBlock<Vec<PropertyDeclaration>>>
|
||||
{
|
||||
|
@ -676,6 +664,18 @@ impl<'le> TElementAttributes for LayoutElement<'le> {
|
|||
self.element.get_unsigned_integer_attribute_for_layout(attribute)
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn get_attr(self, namespace: &Namespace, name: &Atom) -> Option<&'le str> {
|
||||
unsafe { self.element.get_attr_val_for_layout(namespace, name) }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn get_attrs(self, name: &Atom) -> Vec<&'le str> {
|
||||
unsafe {
|
||||
self.element.get_attr_vals_for_layout(name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn get_content(content_list: &content::T) -> Vec<ContentItem> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue