[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d
mitz at apple.com
mitz at apple.com
Thu Dec 3 13:21:09 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit fe72b2ee37253308c7c24d6916b2d1a2dac1b53d
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Oct 27 23:32:44 2009 +0000
Incomplete repaint of text field in relative positioned inline at imdb.com
https://bugs.webkit.org/show_bug.cgi?id=30047
Reviewed by Simon Fraser.
WebCore:
Test: fast/repaint/inline-relative-positioned.html
Implemented offsetFromContainer(), mapLocalToContainer() and
mapAbsoluteToLocalPoint() in RenderInline.
* rendering/RenderBox.h: Fixed argument names in the declaration of
mapLocalToContainer().
* rendering/RenderInline.cpp:
(WebCore::RenderInline::offsetFromContainer):
(WebCore::RenderInline::mapLocalToContainer):
(WebCore::RenderInline::mapAbsoluteToLocalPoint):
* rendering/RenderInline.h:
LayoutTests:
* fast/repaint/inline-relative-positioned-expected.checksum: Added.
* fast/repaint/inline-relative-positioned-expected.png: Added.
* fast/repaint/inline-relative-positioned-expected.txt: Added.
* fast/repaint/inline-relative-positioned.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d050d42..959cd3c 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2009-10-27 Dan Bernstein <mitz at apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Incomplete repaint of text field in relative positioned inline at imdb.com
+ https://bugs.webkit.org/show_bug.cgi?id=30047
+
+ * fast/repaint/inline-relative-positioned-expected.checksum: Added.
+ * fast/repaint/inline-relative-positioned-expected.png: Added.
+ * fast/repaint/inline-relative-positioned-expected.txt: Added.
+ * fast/repaint/inline-relative-positioned.html: Added.
+
2009-10-27 Kinuko Yasuda <kinuko at google.com>
Reviewed by Darin Adler.
diff --git a/LayoutTests/fast/repaint/inline-relative-positioned-expected.checksum b/LayoutTests/fast/repaint/inline-relative-positioned-expected.checksum
new file mode 100644
index 0000000..7e6c92b
--- /dev/null
+++ b/LayoutTests/fast/repaint/inline-relative-positioned-expected.checksum
@@ -0,0 +1 @@
+077f23da02492065a2032cfc2eac25ae
\ No newline at end of file
diff --git a/LayoutTests/fast/repaint/inline-relative-positioned-expected.png b/LayoutTests/fast/repaint/inline-relative-positioned-expected.png
new file mode 100644
index 0000000..21204b4
Binary files /dev/null and b/LayoutTests/fast/repaint/inline-relative-positioned-expected.png differ
diff --git a/LayoutTests/fast/repaint/inline-relative-positioned-expected.txt b/LayoutTests/fast/repaint/inline-relative-positioned-expected.txt
new file mode 100644
index 0000000..ff9e31d
--- /dev/null
+++ b/LayoutTests/fast/repaint/inline-relative-positioned-expected.txt
@@ -0,0 +1,15 @@
+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
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+layer at (8,88) size 100x18
+ RenderInline (relative positioned) {SPAN} at (0,0) size 100x18
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+layer at (8,88) size 100x100
+ RenderBlock {DIV} at (0,0) size 100x100 [color=#008000] [bgcolor=#FF0000]
+ RenderText {#text} at (0,0) size 100x100
+ text run at (0,0) width 100: "a"
diff --git a/LayoutTests/fast/repaint/inline-relative-positioned.html b/LayoutTests/fast/repaint/inline-relative-positioned.html
new file mode 100644
index 0000000..7bfc8ac
--- /dev/null
+++ b/LayoutTests/fast/repaint/inline-relative-positioned.html
@@ -0,0 +1,11 @@
+<script src="resources/repaint.js"></script>
+<body onload="runRepaintTest()">
+<span style="position: relative; top: 80px;">
+ <div id="target" style="display: inline-block; width: 100px; height: 100px; overflow: hidden; font-family: ahem; font-size: 100px; background: red; color: green;">p</div>
+</span>
+<script>
+ function repaintTest()
+ {
+ document.getElementById("target").firstChild.data = "a";
+ }
+</script>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 04d7d27..061a54a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2009-10-27 Dan Bernstein <mitz at apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Incomplete repaint of text field in relative positioned inline at imdb.com
+ https://bugs.webkit.org/show_bug.cgi?id=30047
+
+ Test: fast/repaint/inline-relative-positioned.html
+
+ Implemented offsetFromContainer(), mapLocalToContainer() and
+ mapAbsoluteToLocalPoint() in RenderInline.
+
+ * rendering/RenderBox.h: Fixed argument names in the declaration of
+ mapLocalToContainer().
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::offsetFromContainer):
+ (WebCore::RenderInline::mapLocalToContainer):
+ (WebCore::RenderInline::mapAbsoluteToLocalPoint):
+ * rendering/RenderInline.h:
+
2009-10-27 Jeremy Orlow <jorlow at chromium.org>
Speculative build fix for Chromium.
diff --git a/WebCore/rendering/RenderBox.h b/WebCore/rendering/RenderBox.h
index 41c5622..9050dcb 100644
--- a/WebCore/rendering/RenderBox.h
+++ b/WebCore/rendering/RenderBox.h
@@ -318,7 +318,7 @@ protected:
virtual bool shouldCalculateSizeAsReplaced() const { return isReplaced() && !isInlineBlockOrInlineTable(); }
- virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&) const;
+ virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState&) const;
virtual void mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, TransformState&) const;
private:
diff --git a/WebCore/rendering/RenderInline.cpp b/WebCore/rendering/RenderInline.cpp
index 05d29d0..0302113 100644
--- a/WebCore/rendering/RenderInline.cpp
+++ b/WebCore/rendering/RenderInline.cpp
@@ -30,6 +30,7 @@
#include "RenderArena.h"
#include "RenderBlock.h"
#include "RenderView.h"
+#include "TransformState.h"
#include "VisiblePosition.h"
#if ENABLE(DASHBOARD_SUPPORT)
@@ -705,6 +706,92 @@ void RenderInline::computeRectForRepaint(RenderBoxModelObject* repaintContainer,
o->computeRectForRepaint(repaintContainer, rect, fixed);
}
+IntSize RenderInline::offsetFromContainer(RenderObject* container) const
+{
+ ASSERT(container == this->container());
+
+ IntSize offset;
+ if (isRelPositioned())
+ offset += relativePositionOffset();
+
+ if (!isInline() || isReplaced()) {
+ RenderBlock* cb;
+ if (container->isBlockFlow() && (cb = toRenderBlock(container))->hasColumns()) {
+ IntRect rect(0, 0, 1, 1);
+ cb->adjustRectForColumns(rect);
+ }
+ }
+
+ if (container->hasOverflowClip())
+ offset -= toRenderBox(container)->layer()->scrolledContentOffset();
+
+ return offset;
+}
+
+void RenderInline::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState) const
+{
+ if (repaintContainer == this)
+ return;
+
+ if (RenderView *v = view()) {
+ if (v->layoutStateEnabled() && !repaintContainer) {
+ LayoutState* layoutState = v->layoutState();
+ IntSize offset = layoutState->m_offset;
+ if (style()->position() == RelativePosition && layer())
+ offset += layer()->relativePositionOffset();
+ transformState.move(offset);
+ return;
+ }
+ }
+
+ bool containerSkipped;
+ RenderObject* o = container(repaintContainer, &containerSkipped);
+ if (!o)
+ return;
+
+ IntSize containerOffset = offsetFromContainer(o);
+
+ bool preserve3D = useTransforms && (o->style()->preserves3D() || style()->preserves3D());
+ if (useTransforms && shouldUseTransformFromContainer(o)) {
+ TransformationMatrix t;
+ getTransformFromContainer(o, containerOffset, t);
+ transformState.applyTransform(t, preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
+ } else
+ transformState.move(containerOffset.width(), containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
+
+ if (containerSkipped) {
+ // There can't be a transform between repaintContainer and o, because transforms create containers, so it should be safe
+ // to just subtract the delta between the repaintContainer and o.
+ IntSize containerOffset = repaintContainer->offsetFromAncestorContainer(o);
+ transformState.move(-containerOffset.width(), -containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
+ return;
+ }
+
+ o->mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState);
+}
+
+void RenderInline::mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, TransformState& transformState) const
+{
+ // We don't expect this function to be called during layout.
+ ASSERT(!view() || !view()->layoutStateEnabled());
+
+ RenderObject* o = container();
+ if (!o)
+ return;
+
+ o->mapAbsoluteToLocalPoint(fixed, useTransforms, transformState);
+
+ IntSize containerOffset = offsetFromContainer(o);
+
+ bool preserve3D = useTransforms && (o->style()->preserves3D() || style()->preserves3D());
+ if (useTransforms && shouldUseTransformFromContainer(o)) {
+ TransformationMatrix t;
+ getTransformFromContainer(o, containerOffset, t);
+ transformState.applyTransform(t, preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
+ } else
+ transformState.move(-containerOffset.width(), -containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
+}
+
void RenderInline::updateDragState(bool dragOn)
{
RenderBoxModelObject::updateDragState(dragOn);
diff --git a/WebCore/rendering/RenderInline.h b/WebCore/rendering/RenderInline.h
index 8e0064e..8e9715c 100644
--- a/WebCore/rendering/RenderInline.h
+++ b/WebCore/rendering/RenderInline.h
@@ -44,6 +44,8 @@ public:
virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
virtual void absoluteQuads(Vector<FloatQuad>&);
+ virtual IntSize offsetFromContainer(RenderObject*) const;
+
IntRect linesBoundingBox() const;
IntRect linesVisibleOverflowBoundingBox() const;
@@ -107,6 +109,9 @@ private:
virtual IntRect rectWithOutlineForRepaint(RenderBoxModelObject* repaintContainer, int outlineWidth);
virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& rect, bool fixed);
+ virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState&) const;
+ virtual void mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, TransformState&) const;
+
virtual VisiblePosition positionForPoint(const IntPoint&);
virtual IntRect borderBoundingBox() const
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list