text-emphasis-position does not support optional left / right values
Categories
(Firefox :: Untriaged, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox108 | --- | fixed |
People
(Reporter: anurag.kalia, Assigned: anurag.kalia)
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:105.0) Gecko/20100101 Firefox/105.0
Steps to reproduce:
Actual results:
It does not support text-emphasis-position: over or text-emphasis-position: under
Expected results:
It should have worked just like text-emphasis-position: over right / text-emphasis-position: under right, respectively.
| Assignee | ||
Comment 1•3 years ago
|
||
Related discussion:
https://bugzilla.mozilla.org/show_bug.cgi?id=1784022#c3 and https://bugzilla.mozilla.org/show_bug.cgi?id=1784022#c5
| Assignee | ||
Comment 2•3 years ago
|
||
I will work on this as per the discussion in the attached links.
| Assignee | ||
Comment 3•3 years ago
|
||
Updated•3 years ago
|
| Assignee | ||
Comment 4•3 years ago
|
||
Hi emilio! I am back with a new question. I made the changes as you suggested for making left/right in text-emphasis-position optional. I followed the blueprint in your comment and the changes can be seen in the phabricator.
Now, a potential problem I am facing is by reproducing the steps as follows:
- In the locally built browser with the changes, navigate to https://developer.mozilla.org/en-US/docs/Web/CSS/text-emphasis-position. You will see the interactive example with
text-emphasis-position: over right;selected by default and "happy than right" having blue dots over it. - Open developer console and highlight the element "happy than right" (span#example-element).
Expected: Value of text-emphasis-position for span#example-element should be over right.
Observed: Value of text-emphasis-position for span#example-element is over.
Further Research
I digged into it and figured out that it is happening on using style.cssText = 'text-emphasis-position: over right;' for it and both over right and over are parsed to the same numeric value.
When I checked the docs for style.cssText, I found the following steps (cssom-1/#dom-cssstyledeclaration-csstext):
Setting the cssText attribute must run these steps:
- If the computed flag is set, then throw a NoModificationAllowedError exception.
- Empty the declarations.
- Parse the given value and, if the return value is not the empty list, insert the items in the list into the declarations, in specified order.
- Update style attribute for the CSS declaration block.
Basically, we have to "Parse the given value" where over right becomes equivalent to over and when we serialize it back during "Update the style attribute", it turns into over because that it cannot distinguish between the two.
My question is, is it okay? I tried to drill down into the definitions of parsing and could not figure out if this is allowed. Is there any other similar example for optional values for other CSS properties? Moreover, I could not see tests for the same for cssText so that also could not help me here.
Comment 5•3 years ago
|
||
Replied to your question in phabricator, but yes, it's ok (and in fact generally the right thing to do) to serialize to the shortest form. See all the #[css(skip_if...)] usage which also behaves the same way.
| Assignee | ||
Comment 6•3 years ago
|
||
Hi Emilio! No hurry, but I was worrying if my request on phabricator did not reach you. So, asking for information here too. Thanks! It was about running tests which passed but I am not sure if it was the correct query. So needed confirmation from you for that.
Comment 10•3 years ago
|
||
Comment 11•3 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/186bc4e56d14
https://hg.mozilla.org/mozilla-central/rev/81300558527a
https://hg.mozilla.org/mozilla-central/rev/6e67171775b3
Description
•