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

If both html attr and css property are existed, how to handle that? #1515

Closed
aydinkim opened this issue Jan 17, 2014 · 4 comments
Closed

If both html attr and css property are existed, how to handle that? #1515

aydinkim opened this issue Jan 17, 2014 · 4 comments

Comments

@aydinkim
Copy link

@aydinkim aydinkim commented Jan 17, 2014

I am now working with html list - ul, ol, li element.

For example,

<ol type="A">
    <li style="list-style-type:decimal"> CSS
    <li style="list-style-type:upper-roman"> DOM
    <li> IMAGE
</ol>

the correct output is

  1. CSS
    Ⅱ. DOM
    C. IMAGE
    but we cannot decide to apply the html attribute("A") or not because the css style value is alway set to specific values described in default user agent stylesheet like decimal or disc, not none.

In aspect of HTML attribute processing, it need to know whether corresponding css properties are set by user or not.

As quote of HTML 4.01 spec,

10.3.1 Visual rendering of lists
Note that the type attribute is deprecated and list styles should be handled through style sheets.

But to support backward compatibility, we need to implement the style&attr overlap case better or not.

Any idea for this?

@bzbarsky
Copy link
Contributor

@bzbarsky bzbarsky commented Jan 17, 2014

The spec describes how to do this. Specifically, http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#decohints describes how to map the type attribute to CSS presentational hints, and since the list-style-type property is inherited by default the list items pick up the lists's value unless they have another style set explicitly.

@bzbarsky
Copy link
Contributor

@bzbarsky bzbarsky commented Jan 17, 2014

Oh, and please don't bother reading the HTML 4 spec. It doesn't actually define much in the way of UA behavior, and much of what it does define doesn't match today's reality. You want to read the whatwg spec.

@aydinkim
Copy link
Author

@aydinkim aydinkim commented Jan 17, 2014

@bzbarsky Thank you! ah.. This issue might be solved by aydinkim@0d8ee06

@aydinkim aydinkim closed this Jan 17, 2014
@bzbarsky
Copy link
Contributor

@bzbarsky bzbarsky commented Jan 17, 2014

Sort of. UA stylesheet and presenatational hints have different specificity....

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.