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

[css-typed-om] Stringification behavior #268

Closed
jyc opened this Issue Jul 26, 2016 · 8 comments

Comments

Projects
None yet
6 participants
@jyc
Contributor

jyc commented Jul 26, 2016

What is the StylePropertyMapReadOnly supposed to stringify to? It's not clear from the spec.

@shans

This comment has been minimized.

Show comment
Hide comment
@shans

shans Aug 11, 2016

Contributor

Tab will write prose detailing stringification of StylePropertyMapReadOnly.
Shane will write a section describing how CSSStyleValues are serialized.

Contributor

shans commented Aug 11, 2016

Tab will write prose detailing stringification of StylePropertyMapReadOnly.
Shane will write a section describing how CSSStyleValues are serialized.

@shans

This comment has been minimized.

Show comment
Hide comment
@shans

shans Sep 14, 2016

Contributor

There's an issue for discussion here: what representation should we serialize?

Typed OM tries to provide a minimal representation for values - e.g. for positions, 'center' and '50%' are represented as identical values. This is the first option for serialization (minimal representation).

The old CSSOM has an arcane collection of rules around what's squashed and what isn't. 'center' is kept distinct from '50%' in specified style because keywords are represented differently to lengths. Trying to be faithful to these rules is the second option (existing representation).

A third option is to always use the source string when available (faithful representation).

What I've currently specced is a combination of these three representations, but we should work out exactly what behavior we want in what circumstance.

Contributor

shans commented Sep 14, 2016

There's an issue for discussion here: what representation should we serialize?

Typed OM tries to provide a minimal representation for values - e.g. for positions, 'center' and '50%' are represented as identical values. This is the first option for serialization (minimal representation).

The old CSSOM has an arcane collection of rules around what's squashed and what isn't. 'center' is kept distinct from '50%' in specified style because keywords are represented differently to lengths. Trying to be faithful to these rules is the second option (existing representation).

A third option is to always use the source string when available (faithful representation).

What I've currently specced is a combination of these three representations, but we should work out exactly what behavior we want in what circumstance.

@shans

This comment has been minimized.

Show comment
Hide comment
@shans

shans Apr 3, 2017

Contributor

Resolved on the minimal representation for computed style: https://log.csswg.org/irc.w3.org/houdini/2016-09-22/#e727340.

It looks like we settled on the same for specified style too but there's no explicit resolution.

Contributor

shans commented Apr 3, 2017

Resolved on the minimal representation for computed style: https://log.csswg.org/irc.w3.org/houdini/2016-09-22/#e727340.

It looks like we settled on the same for specified style too but there's no explicit resolution.

@shans shans added the Needs Edits label May 23, 2017

chromium-wpt-export-bot added a commit to web-platform-tests/wpt that referenced this issue Jan 4, 2018

[css-typed-om] Add IDL tests for StylePropertyMap(ReadOnly).
This patch uses idlharness.js to test the StylePropertyMap(ReadOnly)
interface.

There's an expected failure due to
w3c/css-houdini-drafts#268

Bug: 774887
Change-Id: Id3bfb55dad2b1a8dd3957b63904fb95b38f602a7
@darrnshn

This comment has been minimized.

Show comment
Hide comment
@darrnshn

darrnshn Jan 5, 2018

Collaborator

Did we resolve what StylePropertyMapReadOnly serializes to?

Collaborator

darrnshn commented Jan 5, 2018

Did we resolve what StylePropertyMapReadOnly serializes to?

chromium-wpt-export-bot added a commit to web-platform-tests/wpt that referenced this issue Jan 9, 2018

[css-typed-om] Add IDL tests for StylePropertyMap(ReadOnly).
This patch uses idlharness.js to test the StylePropertyMap(ReadOnly)
interface.

There's an expected failure due to
w3c/css-houdini-drafts#268

Bug: 774887
Change-Id: Id3bfb55dad2b1a8dd3957b63904fb95b38f602a7
Reviewed-on: https://chromium-review.googlesource.com/848483
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528167}

chromium-wpt-export-bot added a commit to web-platform-tests/wpt that referenced this issue Jan 10, 2018

[css-typed-om] Add IDL tests for StylePropertyMap(ReadOnly).
This patch uses idlharness.js to test the StylePropertyMap(ReadOnly)
interface.

There's an expected failure due to
w3c/css-houdini-drafts#268

Bug: 774887
Change-Id: Id3bfb55dad2b1a8dd3957b63904fb95b38f602a7
Reviewed-on: https://chromium-review.googlesource.com/848483
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528167}

MXEBot pushed a commit to mirror/chromium that referenced this issue Jan 10, 2018

[css-typed-om] Add IDL tests for StylePropertyMap(ReadOnly).
This patch uses idlharness.js to test the StylePropertyMap(ReadOnly)
interface.

There's an expected failure due to
w3c/css-houdini-drafts#268

Bug: 774887
Change-Id: Id3bfb55dad2b1a8dd3957b63904fb95b38f602a7
Reviewed-on: https://chromium-review.googlesource.com/848483
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528167}

@nainar nainar added Needs Design and removed Needs Edits labels Jan 18, 2018

@darrnshn

This comment has been minimized.

Show comment
Hide comment
@darrnshn

darrnshn Jan 29, 2018

Collaborator

Do we actually need a stringifier? AFAIK element.style doesn't have a stringifier either.

Collaborator

darrnshn commented Jan 29, 2018

Do we actually need a stringifier? AFAIK element.style doesn't have a stringifier either.

@tabatkins

This comment has been minimized.

Show comment
Hide comment
@tabatkins

tabatkins Jan 30, 2018

Member

Correct, it doesn't, at least in Chrome - document.body.style + "" just returns "[object CSSStyleDeclaration]", the default object stringification behavior.

So let's punt this indefinitely until someone figures out a need for it?

Member

tabatkins commented Jan 30, 2018

Correct, it doesn't, at least in Chrome - document.body.style + "" just returns "[object CSSStyleDeclaration]", the default object stringification behavior.

So let's punt this indefinitely until someone figures out a need for it?

@tabatkins tabatkins closed this Jan 30, 2018

@tabatkins tabatkins removed the Needs Design label Jan 30, 2018

@bzbarsky

This comment has been minimized.

Show comment
Hide comment
@bzbarsky

bzbarsky Feb 15, 2018

@tabatkins Shouldn't you remove the stringifier from the IDL then?

@tabatkins Shouldn't you remove the stringifier from the IDL then?

@darrnshn darrnshn added the claimed label Feb 15, 2018

@darrnshn

This comment has been minimized.

Show comment
Hide comment
@darrnshn

darrnshn Feb 15, 2018

Collaborator

Oops, we must've forgot ^.^ I'll take this.

Collaborator

darrnshn commented Feb 15, 2018

Oops, we must've forgot ^.^ I'll take this.

nainar added a commit that referenced this issue Feb 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment