Bug 166782

Summary: WebKit implements "word-wrap" as a weird sort of alias which shows up in serializations alongside its alias-target
Product: WebKit Reporter: Daniel Holbert <dholbert>
Component: CSSAssignee: Tim Nguyen (:ntim) <ntim>
Status: RESOLVED FIXED    
Severity: Normal CC: ntim, obrufau, webkit-bug-importer
Priority: P2 Keywords: InRadar, WPTImpact
Version: Safari 10   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.chromium.org/p/chromium/issues/detail?id=679068
Bug Depends on:    
Bug Blocks: 240341, 239579    
Attachments:
Description Flags
Patch for landing ntim: commit-queue-

Description Daniel Holbert 2017-01-06 15:48:51 PST
STR:
(1) Visit https://jsfiddle.net/5esq3oc8/
(2) Inspect the serialization of the div's CSS rule for its "style" attribute. (Shown in an alert dialog)

EXPECTED RESULTS:
"word-wrap" should not appear (since it's an alias for "overflow-wrap").

ACTUAL RESULTS:
"word-wrap" and "overflow-wrap" *BOTH* appear, despite the fact that the former is an alias for the latter!  In contrast, the other alias included in this testcase (-webkit-align-items) does not show up -- for that one, only the main property appears in the serialization.


NOTES:
* This bug affects Chrome/Blink as well; the Blink instance of this bug report is https://bugs.chromium.org/p/chromium/issues/detail?id=679068
* The spec text here is pretty hand-wavy, and Manish filed https://github.com/w3c/csswg-drafts/issues/866 on that.  Right now it says "UAs must treat word-wrap as an alternate name for the overflow-wrap property, as if it were a shorthand of overflow-wrap." https://drafts.csswg.org/css-text-3/#propdef-word-wrap
* That spec text seems to be basically describing the concept of an alias ("an alternate name", "as if it were a shorthand" -- notably *not* saying that it's *actually* a shorthand).  So, WebKit should be doing its standard legacy aliasing thing here, just like it does for -webkit-align-items. I'm not sure why it has different behavior for this one special property. Probably some weird historical cruft, I'm guessing, which can be cleaned up now? :)


I tested in Safari 10 on sierra and got ACTUAL RESULTS. Chrome 57 dev edition also gives ACTUAL RESULTS.
Firefox Nightly 53 gives EXPECTED RESULTS. Edge 14 gives an entirely different behavior because they don't yet support "overflow-wrap" (https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/6524680-update-word-wrap-to-overflow-wrap )
Comment 1 Tim Nguyen (:ntim) 2022-04-27 10:12:29 PDT
Pull Request: https://github.com/WebKit/WebKit/pull/411
Comment 2 EWS 2022-04-27 11:56:52 PDT
Committed r293521 (250052@main): <https://commits.webkit.org/250052@main>

Reviewed commits have been landed. Closing PR #411 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2022-04-27 11:57:12 PDT
<rdar://problem/92412149>
Comment 4 Tim Nguyen (:ntim) 2022-04-27 12:12:32 PDT
Reopening to attach new patch.
Comment 5 Tim Nguyen (:ntim) 2022-04-27 12:12:35 PDT
Created attachment 458459 [details]
Patch for landing
Comment 6 Tim Nguyen (:ntim) 2022-04-27 12:13:57 PDT
Committed r293528 (250057@trunk): <https://commits.webkit.org/250057@trunk>
Comment 7 Tim Nguyen (:ntim) 2022-04-28 09:28:18 PDT
Committed r293574 (250088@trunk): <https://commits.webkit.org/250088@trunk>