mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Don't escape property name in CSSStyleDeclaration's item() (#31305)
Just return the raw name. This is only relevant for custom properties.
This commit is contained in:
parent
8b91d8b11e
commit
cb5172f40e
3 changed files with 2 additions and 19 deletions
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use cssparser::CssStringWriter;
|
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever::local_name;
|
use html5ever::local_name;
|
||||||
use servo_arc::Arc;
|
use servo_arc::Arc;
|
||||||
|
@ -15,7 +14,7 @@ use style::properties::{
|
||||||
use style::selector_parser::PseudoElement;
|
use style::selector_parser::PseudoElement;
|
||||||
use style::shared_lock::Locked;
|
use style::shared_lock::Locked;
|
||||||
use style::stylesheets::{CssRuleType, Origin};
|
use style::stylesheets::{CssRuleType, Origin};
|
||||||
use style_traits::{CssWriter, ParsingMode, ToCss};
|
use style_traits::ParsingMode;
|
||||||
|
|
||||||
use crate::dom::bindings::codegen::Bindings::CSSStyleDeclarationBinding::CSSStyleDeclarationMethods;
|
use crate::dom::bindings::codegen::Bindings::CSSStyleDeclarationBinding::CSSStyleDeclarationMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
|
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
|
||||||
|
@ -432,11 +431,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
|
||||||
fn IndexedGetter(&self, index: u32) -> Option<DOMString> {
|
fn IndexedGetter(&self, index: u32) -> Option<DOMString> {
|
||||||
self.owner.with_block(|pdb| {
|
self.owner.with_block(|pdb| {
|
||||||
let declaration = pdb.declarations().get(index as usize)?;
|
let declaration = pdb.declarations().get(index as usize)?;
|
||||||
let mut dest = String::new();
|
Some(DOMString::from(declaration.id().name()))
|
||||||
let mut writer = CssStringWriter::new(&mut dest);
|
|
||||||
let mut writer = CssWriter::new(&mut writer);
|
|
||||||
declaration.id().to_css(&mut writer).ok()?;
|
|
||||||
Some(DOMString::from(dest))
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
[variable-names.html]
|
|
||||||
[custom property '--a;b']
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[custom property '--\\']
|
|
||||||
expected: FAIL
|
|
|
@ -1,6 +0,0 @@
|
||||||
[variable-names.html]
|
|
||||||
[custom property '--a;b']
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[custom property '--\\']
|
|
||||||
expected: FAIL
|
|
Loading…
Add table
Add a link
Reference in a new issue