Bug 218090 - [css-logical] Fix getComputedStyle for logical properties
Summary: [css-logical] Fix getComputedStyle for logical properties
Status: RESOLVED DUPLICATE of bug 226461
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 185977
  Show dependency treegraph
 
Reported: 2020-10-22 10:27 PDT by Simon Fraser (smfr)
Modified: 2023-05-14 09:05 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2020-10-22 10:27:02 PDT
- Fix CSSOM problems like:
    document.documentElement.style.marginLeft = "1px";
    getComputedStyle(document.documentElement).marginLeft; // "1px", good
    document.documentElement.style.marginInlineStart = "2px";
    getComputedStyle(document.documentElement).marginLeft; // "2px", good
    document.documentElement.style.marginLeft = "3px";
    getComputedStyle(document.documentElement).marginLeft; // "2px", bad, should be "3px"
Comment 1 Radar WebKit Bug Importer 2020-10-22 10:27:21 PDT
<rdar://problem/70578989>
Comment 2 Oriol Brufau 2020-10-22 10:32:02 PDT
Note the underlying problem is not in getComputedStyle,

    document.documentElement.style.marginLeft = "1px";
    document.documentElement.style.cssText; // "margin-left: 1px;"
    document.documentElement.style.marginInlineStart = "2px";
    document.documentElement.style.cssText; // "margin-left: 1px; margin-inline-start: 2px;"​
    document.documentElement.style.marginLeft = "3px";
    document.documentElement.style.cssText; // "margin-left: 3px; margin-inline-start: 2px;"

the last one should become "margin-inline-start: 2px; margin-left: 3px;" so that margin-left takes precedence.

Chromium has the same problem, Firefox does it right.
Comment 3 Oriol Brufau 2023-05-14 09:05:40 PDT
Fixed in bug 226461.

*** This bug has been marked as a duplicate of bug 226461 ***