- fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9316
REGRESSION: text field width shrinks on first keystroke
Test: fast/forms/floating-textfield-relayout.html
* page/FrameView.cpp:
(WebCore::FrameView::layoutRoot): Added. During subtree relayout, returns
the subtree root. Otherwise returns 0.
(WebCore::FrameView::layoutPending): Made const.
* page/FrameView.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::calcWidth): Added early return if this is the root
of a subtree being laid out.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15013
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-06-24 Mitz Pettel <opendarwin.org@mitzpettel.com>
+
+ Reviewed by Darin. landed by ap.
+
+ - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=9316
+ REGRESSION: text field width shrinks on first keystroke
+
+ * fast/forms/floating-textfield-relayout-expected.checksum: Added.
+ * fast/forms/floating-textfield-relayout-expected.png: Added.
+ * fast/forms/floating-textfield-relayout-expected.txt: Added.
+ * fast/forms/floating-textfield-relayout.html: Added.
+
2006-06-24 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by Hyatt.
--- /dev/null
+4466cd49965bbccb0819083a4767c0e1
+\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {P} at (0,0) size 784x36
+ RenderText {#text} at (0,0) size 104x18
+ text run at (0,0) width 104: "This is a test for "
+ RenderInline {I} at (0,0) size 750x36
+ RenderInline {A} at (0,0) size 348x18 [color=#0000EE]
+ RenderText {#text} at (104,0) size 348x18
+ text run at (104,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9316"
+ RenderText {#text} at (452,0) size 750x36
+ text run at (452,0) width 4: " "
+ text run at (456,0) width 294: "REGRESSION: text field width shrinks on first"
+ text run at (0,18) width 59: "keystroke"
+ RenderText {#text} at (59,18) size 4x18
+ text run at (59,18) width 4: "."
+ RenderBlock {HR} at (0,52) size 784x2 [border: (1px inset #000000)]
+layer at (8,70) size 784x0
+ RenderBlock (relative positioned) {DIV} at (0,62) size 784x0
+ RenderTextField {INPUT} at (0,2) size 392x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+layer at (11,75) size 386x13
+ RenderBlock {DIV} at (3,3) size 386x13
+ RenderText {#text} at (1,0) size 18x13
+ text run at (1,0) width 18: "foo"
--- /dev/null
+<html>
+<head>
+ <title></title>
+ <script type="text/javascript">
+ function test()
+ {
+ document.body.offsetTop;
+ var field = document.getElementById('field');
+ field.value = "foo";
+ }
+ </script>
+</head>
+<body onload="test()">
+ <p>
+ This is a test for <i><a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=9316">http://bugzilla.opendarwin.org/show_bug.cgi?id=9316</a>
+ REGRESSION: text field width shrinks on first keystroke</i>.
+ </p>
+ <hr>
+ <div style="position: relative;">
+ <input id="field" style="width: 50%; float: left">
+ </div>
+</body>
+2006-06-24 Mitz Pettel <opendarwin.org@mitzpettel.com>
+
+ Reviewed by Darin, landed by ap.
+
+ - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9316
+ REGRESSION: text field width shrinks on first keystroke
+
+ Test: fast/forms/floating-textfield-relayout.html
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::layoutRoot): Added. During subtree relayout, returns
+ the subtree root. Otherwise returns 0.
+ (WebCore::FrameView::layoutPending): Made const.
+ * page/FrameView.h:
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::calcWidth): Added early return if this is the root
+ of a subtree being laid out.
+
2006-06-24 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by Hyatt.
d->repaintRects->append(new RenderObject::RepaintInfo(o, r));
}
+Node* FrameView::layoutRoot() const
+{
+ return layoutPending() ? 0 : d->layoutRoot.get();
+}
+
void FrameView::layout(bool allowSubtree)
{
d->layoutTimer.stop();
}
}
-bool FrameView::layoutPending()
+bool FrameView::layoutPending() const
{
return d->layoutTimer.isActive();
}
void layout(bool allowSubtree = true);
+ Node* layoutRoot() const;
int layoutCount() const;
bool needsFullRepaint() const;
void scheduleRelayoutOfSubtree(Node*);
void unscheduleRelayout();
bool haveDelayedLayoutScheduled();
- bool layoutPending();
+ bool layoutPending() const;
void scheduleHoverStateUpdate();
return;
}
+ // If layout is limited to a subtree, the subtree root's width does not change.
+ if (node() && view()->frameView() && view()->frameView()->layoutRoot() == node())
+ return;
+
// The parent box is flexing us, so it has increased or decreased our
// width. Use the width from the style context.
if (m_overrideSize != -1 && parent()->style()->boxOrient() == HORIZONTAL