Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`getPropertyValue` can't read `outline` #20903

Closed
tigercosmos opened this issue Jun 2, 2018 · 3 comments
Closed

`getPropertyValue` can't read `outline` #20903

tigercosmos opened this issue Jun 2, 2018 · 3 comments

Comments

@tigercosmos
Copy link
Collaborator

@tigercosmos tigercosmos commented Jun 2, 2018

<style>
  #out {
    outline: .2em solid red;
  }
</style>
<span id="out">
  <span id="in">link</span>
  <span id="in">href</span>
</span>
<script>
  var val = window.getComputedStyle(document.querySelector("#out")).getPropertyValue('outline');
  console.log(val);
</script>

should get rgb(255, 0, 0) solid 2.66667px, but log nothing in Servo.

related code:

fn get_property_value(&self, id: PropertyId) -> DOMString {
if self.readonly {
// Readonly style declarations are used for getComputedStyle.
return self.get_computed_style(id);
}

fn get_computed_style(&self, property: PropertyId) -> DOMString {

@emilio
Copy link
Member

@emilio emilio commented Jun 2, 2018

That's because outline is a shorthand, and we return the empty string for those.

I think we should support shorthands in getComputedStyle and I'm doing related work in FF, but FF also returns the empty string.

@tigercosmos
Copy link
Collaborator Author

@tigercosmos tigercosmos commented Jun 2, 2018

I see. I use Chrome to test and didn't find FF not support, too.

@mrobinson
Copy link
Member

@mrobinson mrobinson commented May 9, 2020

I'm going to close this as a duplicate of #22838, which seems to have a bit more information.

@mrobinson mrobinson closed this May 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.