[webkit-changes] cvs commit: WebCore/kwq KWQRenderTreeDebug.cpp
Justin
justing at opensource.apple.com
Thu Oct 13 15:45:58 PDT 2005
justing 05/10/13 15:45:57
Modified: . ChangeLog
khtml/rendering render_layer.cpp render_layer.h
kwq KWQRenderTreeDebug.cpp
Log:
Reviewed by hyatt
<rdar://problem/3643259> contentEditable=true elements do not acquire the caret or focus halo when overflow:scroll
Test cases added:
* fast/clip/outline-overflowClip
Test cases changed (since I added the outline rect to the render tree dump)
* fast/clip/001
* fast/clip/009
* fast/clip/010
* fast/clip/011
* fast/clip/012
* fast/clip/013
* fast/clip/014
* fast/clip/016
* khtml/rendering/render_layer.cpp:
Clip the outline by a new rect, which is equal to the foreground rect w/o clipping
by the overflow rect.
(khtml::RenderLayer::paintLayer):
(khtml::RenderLayer::hitTestLayer):
(khtml::RenderLayer::calculateRects):
* khtml/rendering/render_layer.h:
* kwq/KWQRenderTreeDebug.cpp:
(write):
(writeLayers):
Revision Changes Path
1.241 +30 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.240
retrieving revision 1.241
diff -u -r1.240 -r1.241
--- ChangeLog 13 Oct 2005 22:07:46 -0000 1.240
+++ ChangeLog 13 Oct 2005 22:45:48 -0000 1.241
@@ -1,3 +1,33 @@
+2005-10-13 Justin Garcia <justin.garcia at apple.com>
+
+ Reviewed by hyatt
+
+ <rdar://problem/3643259> contentEditable=true elements do not acquire the caret or focus halo when overflow:scroll
+
+ Test cases added:
+ * fast/clip/outline-overflowClip
+ Test cases changed (since I added the outline rect to the render tree dump)
+ * fast/clip/001
+ * fast/clip/009
+ * fast/clip/010
+ * fast/clip/011
+ * fast/clip/012
+ * fast/clip/013
+ * fast/clip/014
+ * fast/clip/016
+
+ * khtml/rendering/render_layer.cpp:
+ Clip the outline by a new rect, which is equal to the foreground rect w/o clipping
+ by the overflow rect.
+
+ (khtml::RenderLayer::paintLayer):
+ (khtml::RenderLayer::hitTestLayer):
+ (khtml::RenderLayer::calculateRects):
+ * khtml/rendering/render_layer.h:
+ * kwq/KWQRenderTreeDebug.cpp:
+ (write):
+ (writeLayers):
+
2005-10-13 Antti Koivisto <koivisto at iki.fi>
Reviewed by Darin.
1.109 +12 -7 WebCore/khtml/rendering/render_layer.cpp
Index: render_layer.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_layer.cpp,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -r1.108 -r1.109
--- render_layer.cpp 6 Oct 2005 18:37:42 -0000 1.108
+++ render_layer.cpp 13 Oct 2005 22:45:54 -0000 1.109
@@ -874,8 +874,8 @@
RenderObject *paintingRoot)
{
// Calculate the clip rects we should use.
- QRect layerBounds, damageRect, clipRectToApply;
- calculateRects(rootLayer, paintDirtyRect, layerBounds, damageRect, clipRectToApply);
+ QRect layerBounds, damageRect, clipRectToApply, outlineRect;
+ calculateRects(rootLayer, paintDirtyRect, layerBounds, damageRect, clipRectToApply, outlineRect);
int x = layerBounds.x();
int y = layerBounds.y();
@@ -953,12 +953,15 @@
renderer()->paint(info, tx, ty);
info.phase = PaintActionForeground;
renderer()->paint(info, tx, ty);
- info.phase = PaintActionOutline;
- renderer()->paint(info, tx, ty);
}
// Now restore our clip.
restoreClip(p, paintDirtyRect, clipRectToApply);
+
+ setClip(p, paintDirtyRect, outlineRect);
+ info.phase = PaintActionOutline;
+ renderer()->paint(info, tx, ty);
+ restoreClip(p, paintDirtyRect, outlineRect);
}
// Now walk the sorted list of children with positive z-indices.
@@ -1012,8 +1015,8 @@
int xMousePos, int yMousePos, const QRect& hitTestRect)
{
// Calculate the clip rects we should use.
- QRect layerBounds, bgRect, fgRect;
- calculateRects(rootLayer, hitTestRect, layerBounds, bgRect, fgRect);
+ QRect layerBounds, bgRect, fgRect, outlineRect;
+ calculateRects(rootLayer, hitTestRect, layerBounds, bgRect, fgRect, outlineRect);
// Ensure our z-order lists are up-to-date.
updateZOrderLists();
@@ -1148,7 +1151,7 @@
}
void RenderLayer::calculateRects(const RenderLayer* rootLayer, const QRect& paintDirtyRect, QRect& layerBounds,
- QRect& backgroundRect, QRect& foregroundRect)
+ QRect& backgroundRect, QRect& foregroundRect, QRect& outlineRect)
{
if (parent()) {
parent()->calculateClipRects(rootLayer);
@@ -1159,6 +1162,7 @@
} else
backgroundRect = paintDirtyRect;
foregroundRect = backgroundRect;
+ outlineRect = backgroundRect;
int x = 0;
int y = 0;
@@ -1175,6 +1179,7 @@
QRect newPosClip = m_object->getClipRect(x,y);
backgroundRect = backgroundRect.intersect(newPosClip);
foregroundRect = foregroundRect.intersect(newPosClip);
+ outlineRect = outlineRect.intersect(newPosClip);
}
// If we establish a clip at all, then go ahead and make sure our background
1.49 +1 -1 WebCore/khtml/rendering/render_layer.h
Index: render_layer.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_layer.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- render_layer.h 6 Oct 2005 00:53:57 -0000 1.48
+++ render_layer.h 13 Oct 2005 22:45:55 -0000 1.49
@@ -279,7 +279,7 @@
// |rootLayer}. It also computes our background and foreground clip rects
// for painting/event handling.
void calculateRects(const RenderLayer* rootLayer, const QRect& paintDirtyRect, QRect& layerBounds,
- QRect& backgroundRect, QRect& foregroundRect);
+ QRect& backgroundRect, QRect& foregroundRect, QRect& outlineRect);
void calculateClipRects(const RenderLayer* rootLayer);
ClipRects* clipRects() const { return m_clipRects; }
1.47 +7 -5 WebCore/kwq/KWQRenderTreeDebug.cpp
Index: KWQRenderTreeDebug.cpp
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQRenderTreeDebug.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- KWQRenderTreeDebug.cpp 3 Oct 2005 21:13:08 -0000 1.46
+++ KWQRenderTreeDebug.cpp 13 Oct 2005 22:45:56 -0000 1.47
@@ -298,7 +298,7 @@
}
static void write(QTextStream &ts, RenderLayer &l,
- const QRect& layerBounds, const QRect& backgroundClipRect, const QRect& clipRect,
+ const QRect& layerBounds, const QRect& backgroundClipRect, const QRect& clipRect, const QRect& outlineClipRect,
int layerType = 0, int indent = 0)
{
writeIndent(ts, indent);
@@ -310,6 +310,8 @@
ts << " backgroundClip " << backgroundClipRect;
if (layerBounds != layerBounds.intersect(clipRect))
ts << " clip " << clipRect;
+ if (layerBounds != layerBounds.intersect(outlineClipRect))
+ ts << " outlineClip " << outlineClipRect;
if (l.renderer()->hasOverflowClip()) {
if (l.scrollXOffset())
@@ -337,8 +339,8 @@
const QRect& paintDirtyRect, int indent)
{
// Calculate the clip rects we should use.
- QRect layerBounds, damageRect, clipRectToApply;
- l->calculateRects(rootLayer, paintDirtyRect, layerBounds, damageRect, clipRectToApply);
+ QRect layerBounds, damageRect, clipRectToApply, outlineRect;
+ l->calculateRects(rootLayer, paintDirtyRect, layerBounds, damageRect, clipRectToApply, outlineRect);
// Ensure our z-order lists are up-to-date.
l->updateZOrderLists();
@@ -346,7 +348,7 @@
bool shouldPaint = l->intersectsDamageRect(layerBounds, damageRect);
QPtrVector<RenderLayer>* negList = l->negZOrderList();
if (shouldPaint && negList && negList->count() > 0)
- write(ts, *l, layerBounds, damageRect, clipRectToApply, -1, indent);
+ write(ts, *l, layerBounds, damageRect, clipRectToApply, outlineRect, -1, indent);
if (negList) {
for (unsigned i = 0; i != negList->count(); ++i)
@@ -354,7 +356,7 @@
}
if (shouldPaint)
- write(ts, *l, layerBounds, damageRect, clipRectToApply, negList && negList->count() > 0, indent);
+ write(ts, *l, layerBounds, damageRect, clipRectToApply, outlineRect, negList && negList->count() > 0, indent);
QPtrVector<RenderLayer>* posList = l->posZOrderList();
if (posList) {
More information about the webkit-changes
mailing list