[Webkit-unassigned] [Bug 271626] New: [serialization] font-family serialization should be kept as-is with quotes.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 25 04:57:16 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=271626

            Bug ID: 271626
           Summary: [serialization] font-family serialization should be
                    kept as-is with quotes.
           Product: WebKit
           Version: Safari 17
          Hardware: Unspecified
               URL: http://wpt.live/css/css-fonts/parsing/font-family-comp
                    uted.html
                OS: Unspecified
            Status: NEW
          Keywords: BrowserCompat, WPTImpact
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: karlcow at apple.com
                CC: vitor.roriz at apple.com,
                    webkit-bug-importer at group.apple.com

With 
  data:text/html,<div style='font-family:"inherit", "serif"'>hello</div>

aka assigning to the div a style attribute.
  var div = document.querySelector('div');
  div.style['font-family'] = '"inherit", "serif"'

We can see that the serialization of the style attribute is wrong in Safari. It normalizes the values without the quotes.


Safari:
> target.style.cssText
< "font-family: inherit, serif;"
> window.getComputedStyle(target).fontFamily
< "inherit, serif"

Firefox, Chrome:
target.style.cssText
'font-family: "inherit", "serif";'
window.getComputedStyle(target).fontFamily
'"inherit", "serif"' 


Same thing is happening for a font-name

Safari
> target.style['font-family'] = '"Helvetica"'
< "\"Helvetica\""
> target.style.cssText
< "font-family: Helvetica;"
> window.getComputedStyle(target).fontFamily
< "Helvetica"


Firefox:
target.style['font-family'] = '"Helvetica"'
'"Helvetica"'
target.style.cssText
'font-family: "Helvetica";'
window.getComputedStyle(target).fontFamily
'"Helvetica"'

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240325/cbc7e47c/attachment.htm>


More information about the webkit-unassigned mailing list