Commit 0e2df434 authored by mitz@apple.com's avatar mitz@apple.com

WebCore:

        Reviewed by Sam Weinig.

        - fix https://bugs.webkit.org/show_bug.cgi?id=15383
          <rdar://problem/5682745> resize: vertical does not restrict to vertical
          resize

        Test: fast/css/resize-single-axis.html

        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::resize): Ignore movement along the non-resizing
        axis.

LayoutTests:

        Reviewed by Sam Weinig.

        - test for https://bugs.webkit.org/show_bug.cgi?id=15383
          <rdar://problem/5682745> resize: vertical does not restrict to vertical
          resize

        * fast/css/resize-single-axis-expected.txt: Added.
        * fast/css/resize-single-axis.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f23f5741
2009-06-21 Dan Bernstein <mitz@apple.com>
Reviewed by Sam Weinig.
- test for https://bugs.webkit.org/show_bug.cgi?id=15383
<rdar://problem/5682745> resize: vertical does not restrict to vertical
resize
* fast/css/resize-single-axis-expected.txt: Added.
* fast/css/resize-single-axis.html: Added.
2009-06-21 Sam Weinig <sam@webkit.org>
Reviewed by Eric Seidel.
......
'both' resized as expected to (100px, 100px).
'horizontal' resized as expected to (100px, 50px).
'vertical' resized as expected to (50px, 100px).
<style>
div {
width: 50px;
height: 50px;
overflow: hidden;
-webkit-box-sizing: border-box;
border: solid;
margin: 10px;
}
#both {
resize: both;
}
#horizontal {
resize: horizontal;
}
#vertical {
resize: vertical;
}
</style>
<pre id="console"></pre>
<div id="both"></div>
<div id="horizontal"></div>
<div id="vertical"></div>
<script type="text/javascript">
function log(message)
{
document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
}
function resize(target)
{
var x = document.body.offsetLeft + target.offsetLeft + target.offsetWidth;
var y = document.body.offsetTop + target.offsetTop + target.offsetHeight;
eventSender.mouseMoveTo(x - 6, y - 6);
eventSender.mouseDown();
eventSender.mouseMoveTo(x + 44, y + 44);
eventSender.mouseUp();
}
function assertSize(target, width, height)
{
var computedStyle = getComputedStyle(target);
var actualWidth = computedStyle.width;
var actualHeight = computedStyle.height;
if (actualWidth === width && actualHeight === height)
log("'" + target.id + "' resized as expected to (" + width + ", " + height + ").");
else
log("FAIL: '" + target.id + "' resized to (" + actualWidth + ", " + actualHeight + ") instead of (" + width + ", " + height + ").");
}
if (window.layoutTestController) {
layoutTestController.dumpAsText();
var both = document.getElementById("both");
var horizontal = document.getElementById("horizontal");
var vertical = document.getElementById("vertical");
resize(both);
resize(horizontal);
resize(vertical);
assertSize(both, "100px", "100px");
assertSize(horizontal, "100px", "50px");
assertSize(vertical, "50px", "100px");
}
</script>
2009-06-21 Dan Bernstein <mitz@apple.com>
Reviewed by Sam Weinig.
- fix https://bugs.webkit.org/show_bug.cgi?id=15383
<rdar://problem/5682745> resize: vertical does not restrict to vertical
resize
Test: fast/css/resize-single-axis.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::resize): Ignore movement along the non-resizing
axis.
2009-06-21 Sam Weinig <sam@webkit.org>
Reviewed by Eric Seidel
......
......@@ -1303,7 +1303,7 @@ void RenderLayer::resize(const PlatformMouseEvent& evt, const IntSize& oldOffset
ExceptionCode ec;
if (difference.width()) {
if (resize != RESIZE_VERTICAL && difference.width()) {
if (element->isFormControlElement()) {
// Make implicit margins from the theme explicit (see <http://bugs.webkit.org/show_bug.cgi?id=9547>).
style->setProperty(CSSPropertyMarginLeft, String::number(renderer->marginLeft() / zoomFactor) + "px", false, ec);
......@@ -1315,7 +1315,7 @@ void RenderLayer::resize(const PlatformMouseEvent& evt, const IntSize& oldOffset
style->setProperty(CSSPropertyWidth, String::number(baseWidth + difference.width()) + "px", false, ec);
}
if (difference.height()) {
if (resize != RESIZE_HORIZONTAL && difference.height()) {
if (element->isFormControlElement()) {
// Make implicit margins from the theme explicit (see <http://bugs.webkit.org/show_bug.cgi?id=9547>).
style->setProperty(CSSPropertyMarginTop, String::number(renderer->marginTop() / zoomFactor) + "px", false, ec);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment