Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r174543 - Computed style for clip is wrong with respect to auto
https://bugs.webkit.org/show_bug.cgi?id=137567 Reviewed by Simon Fraser. Source/WebCore: Make sure that the computed style of clip returns the correct value when the input is "auto", or in this case "rect(auto, auto, auto, auto)". Before this patch it returned "rect(0px, 0px, 0px, 0px)" which was completely wrong. Test: fast/css/computed-clip-with-auto-rect.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::autoOrZoomAdjustedValue): Helper function to make the correct keyword or length. (WebCore::specifiedValueForGridTrackBreadth): It can use the helper too. (WebCore::ComputedStyleExtractor::propertyValue): If the top/right/bottom/left is "auto", add that identifier to the output rectangle. LayoutTests: Test that an input of clip: rect(auto, auto, auto, auto) is the same on the way out. * fast/css/computed-clip-with-auto-rect-expected.txt: Added. * fast/css/computed-clip-with-auto-rect.html: Added. Canonical link: https://commits.webkit.org/154760.116@webkitgtk/2.6 git-svn-id: https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.6@174969 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
bc47012
commit 12bfaf1
Showing
5 changed files
with
99 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
LayoutTests/fast/css/computed-clip-with-auto-rect-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
rect(auto, auto, auto, auto) | ||
|
||
rect(5px, auto, auto, auto) | ||
|
||
rect(auto, 5px, auto, auto) | ||
|
||
rect(auto, auto, 5px, auto) | ||
|
||
rect(auto, auto, auto, 5px) | ||
|
||
rect(5px, auto, 5px, auto) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<style> | ||
div { | ||
width: 10px; | ||
height: 10px; | ||
background-color: green; | ||
} | ||
</style> | ||
<div id="test1" style="clip: rect(auto, auto, auto, auto);"> | ||
<div id="test2" style="clip: rect(5px, auto, auto, auto);"> | ||
<div id="test3" style="clip: rect(auto, 5px, auto, auto);"> | ||
<div id="test4" style="clip: rect(auto, auto, 5px, auto);"> | ||
<div id="test5" style="clip: rect(auto, auto, auto, 5px);"> | ||
<div id="test6" style="clip: rect(5px, auto, 5px, auto);"> | ||
|
||
<script> | ||
|
||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
|
||
function outputStyleForElement(id) { | ||
var element = document.getElementById(id); | ||
var clipStyle = getComputedStyle(element).clip; | ||
var p = document.createElement("p"); | ||
p.innerText = clipStyle; | ||
document.body.appendChild(p); | ||
} | ||
|
||
outputStyleForElement("test1"); | ||
outputStyleForElement("test2"); | ||
outputStyleForElement("test3"); | ||
outputStyleForElement("test4"); | ||
outputStyleForElement("test5"); | ||
outputStyleForElement("test6"); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters