Skip to content

Commit

Permalink
Don't escape property name in CSSStyleDeclaration's item() (#31305)
Browse files Browse the repository at this point in the history
Just return the raw name. This is only relevant for custom properties.
  • Loading branch information
Loirooriol committed Feb 9, 2024
1 parent 8b91d8b commit cb5172f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
9 changes: 2 additions & 7 deletions components/script/dom/cssstyledeclaration.rs
Expand Up @@ -2,7 +2,6 @@
* 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/. */

use cssparser::CssStringWriter;
use dom_struct::dom_struct;
use html5ever::local_name;
use servo_arc::Arc;
Expand All @@ -15,7 +14,7 @@ use style::properties::{
use style::selector_parser::PseudoElement;
use style::shared_lock::Locked;
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::WindowBinding::WindowMethods;
Expand Down Expand Up @@ -432,11 +431,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
fn IndexedGetter(&self, index: u32) -> Option<DOMString> {
self.owner.with_block(|pdb| {
let declaration = pdb.declarations().get(index as usize)?;
let mut dest = String::new();
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))
Some(DOMString::from(declaration.id().name()))
})
}

Expand Down

This file was deleted.

6 changes: 0 additions & 6 deletions tests/wpt/meta/css/cssom/variable-names.html.ini

This file was deleted.

0 comments on commit cb5172f

Please sign in to comment.