Skip to content

Commit 608b46d

Browse files
author
Rune Lillesveen
committed
Revert of getComputedStyle should handle over-constrained properties. (patchset crosswalk-project#7 id:100001 of https://codereview.chromium.org/1988813002/ )
Reason for revert: Other vendors didn't implement this yet. And work with the others to either get all to fix or to change the spec. BUG=614198 Original issue's description: > getComputedStyle should handle over-constrained properties. > > If neither 'left' nor 'right' is 'auto', the position is over-constrained, > and one of them has to be ignored. If 'direction' property of the > containing block is 'ltr', the value of 'left' wins and 'right' > becomes -'left'. If 'direction' of the containing block is 'rtl', > 'right' wins and 'left' is ignored. Detail is described by > https://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#relative-positioning > > BUG=601118 > > Committed: https://crrev.com/c8291dea8bfa84ab9a3220fb9f57eb059e913a05 > Cr-Commit-Position: refs/heads/master@{#394780} [email protected],[email protected],[email protected],[email protected],[email protected] BUG=601118 Review-Url: https://codereview.chromium.org/2016913003 Cr-Commit-Position: refs/heads/master@{#396470} (cherry picked from commit 9835ebf) Review URL: https://codereview.chromium.org/2025523002 . Cr-Commit-Position: refs/branch-heads/2743@{crosswalk-project#116} Cr-Branched-From: 2b3ae3b-refs/heads/master@{#394939}
1 parent aa008be commit 608b46d

7 files changed

+16
-148
lines changed

third_party/WebKit/LayoutTests/fast/css/computed-offset-with-zoom-expected.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
PASS window.getComputedStyle(fixedElement).top is '100px'
2-
PASS window.getComputedStyle(fixedElement).right is '-100px'
3-
PASS window.getComputedStyle(fixedElement).bottom is '-100px'
2+
PASS window.getComputedStyle(fixedElement).right is '100px'
3+
PASS window.getComputedStyle(fixedElement).bottom is '100px'
44
PASS window.getComputedStyle(fixedElement).left is '100px'
55
PASS window.getComputedStyle(percentageElement).top is '50px'
66
PASS window.getComputedStyle(percentageElement).right is '100px'
77
PASS window.getComputedStyle(percentageElement).bottom is '50px'
88
PASS window.getComputedStyle(percentageElement).left is '100px'
99
PASS window.getComputedStyle(viewportElement).top is '60px'
10-
PASS window.getComputedStyle(viewportElement).right is '-80px'
11-
PASS window.getComputedStyle(viewportElement).bottom is '-60px'
10+
PASS window.getComputedStyle(viewportElement).right is '80px'
11+
PASS window.getComputedStyle(viewportElement).bottom is '60px'
1212
PASS window.getComputedStyle(viewportElement).left is '80px'
1313
PASS window.getComputedStyle(fixedElement).top is '100px'
14-
PASS window.getComputedStyle(fixedElement).right is '-100px'
15-
PASS window.getComputedStyle(fixedElement).bottom is '-100px'
14+
PASS window.getComputedStyle(fixedElement).right is '100px'
15+
PASS window.getComputedStyle(fixedElement).bottom is '100px'
1616
PASS window.getComputedStyle(fixedElement).left is '100px'
1717
PASS window.getComputedStyle(percentageElement).top is '50px'
1818
PASS window.getComputedStyle(percentageElement).right is '100px'
1919
PASS window.getComputedStyle(percentageElement).bottom is '50px'
2020
PASS window.getComputedStyle(percentageElement).left is '100px'
2121
PASS window.getComputedStyle(viewportElement).top is '60px'
22-
PASS window.getComputedStyle(viewportElement).right is '-80px'
23-
PASS window.getComputedStyle(viewportElement).bottom is '-60px'
22+
PASS window.getComputedStyle(viewportElement).right is '80px'
23+
PASS window.getComputedStyle(viewportElement).bottom is '60px'
2424
PASS window.getComputedStyle(viewportElement).left is '80px'
2525
PASS window.getComputedStyle(fixedElement).top is '100px'
26-
PASS window.getComputedStyle(fixedElement).right is '-100px'
27-
PASS window.getComputedStyle(fixedElement).bottom is '-100px'
26+
PASS window.getComputedStyle(fixedElement).right is '100px'
27+
PASS window.getComputedStyle(fixedElement).bottom is '100px'
2828
PASS window.getComputedStyle(fixedElement).left is '100px'
2929
PASS window.getComputedStyle(percentageElement).top is '50px'
3030
PASS window.getComputedStyle(percentageElement).right is '100px'
3131
PASS window.getComputedStyle(percentageElement).bottom is '50px'
3232
PASS window.getComputedStyle(percentageElement).left is '100px'
3333
PASS window.getComputedStyle(viewportElement).top is '60px'
34-
PASS window.getComputedStyle(viewportElement).right is '-80px'
35-
PASS window.getComputedStyle(viewportElement).bottom is '-60px'
34+
PASS window.getComputedStyle(viewportElement).right is '80px'
35+
PASS window.getComputedStyle(viewportElement).bottom is '60px'
3636
PASS window.getComputedStyle(viewportElement).left is '80px'
3737
PASS successfullyParsed is true
3838

third_party/WebKit/LayoutTests/fast/css/computed-offset-with-zoom.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,10 @@
5353
document.body.style.zoom = zoomLevel;
5454
var windowWidth = "'" + (window.innerWidth / 10) + "px'";
5555
var windowHeight = "'" + (window.innerHeight / 10) + "px'";
56-
var windowMinusWidth = "'-" + (window.innerWidth / 10) + "px'";
57-
var windowMinusHeight = "'-" + (window.innerHeight / 10) + "px'";
5856

5957
shouldBe("window.getComputedStyle(fixedElement).top", "'100px'");
60-
shouldBe("window.getComputedStyle(fixedElement).right", "'-100px'");
61-
shouldBe("window.getComputedStyle(fixedElement).bottom", "'-100px'");
58+
shouldBe("window.getComputedStyle(fixedElement).right", "'100px'");
59+
shouldBe("window.getComputedStyle(fixedElement).bottom", "'100px'");
6260
shouldBe("window.getComputedStyle(fixedElement).left", "'100px'");
6361

6462
shouldBe("window.getComputedStyle(percentageElement).top", "'50px'");
@@ -67,8 +65,8 @@
6765
shouldBe("window.getComputedStyle(percentageElement).left", "'100px'");
6866

6967
shouldBe("window.getComputedStyle(viewportElement).top", windowHeight);
70-
shouldBe("window.getComputedStyle(viewportElement).right", windowMinusWidth);
71-
shouldBe("window.getComputedStyle(viewportElement).bottom", windowMinusHeight);
68+
shouldBe("window.getComputedStyle(viewportElement).right", windowWidth);
69+
shouldBe("window.getComputedStyle(viewportElement).bottom", windowHeight);
7270
shouldBe("window.getComputedStyle(viewportElement).left", windowWidth);
7371
}
7472
test(0.5);

third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-over-constrained-expected.txt

Lines changed: 0 additions & 17 deletions
This file was deleted.

third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-over-constrained.html

Lines changed: 0 additions & 44 deletions
This file was deleted.

third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-right-auto-expected.txt

Lines changed: 0 additions & 17 deletions
This file was deleted.

third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-right-auto.html

Lines changed: 0 additions & 44 deletions
This file was deleted.

third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,6 @@ static CSSValue* valueForPositionOffset(const ComputedStyle& style, CSSPropertyI
247247
if (offset.isAuto())
248248
return cssValuePool().createIdentifierValue(CSSValueAuto);
249249

250-
if (layoutObject) {
251-
if (!opposite.isAuto() && layoutObject->isInFlowPositioned()) {
252-
LayoutBlock* container = layoutObject->containingBlock();
253-
bool ltr = container->style()->isLeftToRightDirection();
254-
if ((propertyID == CSSPropertyLeft && !ltr) || (propertyID == CSSPropertyRight && ltr) || (propertyID == CSSPropertyBottom))
255-
return zoomAdjustedPixelValue(-opposite.pixels(), style);
256-
}
257-
}
258250
return zoomAdjustedPixelValueForLength(offset, style);
259251
}
260252

0 commit comments

Comments
 (0)