[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
hyatt
hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:14:56 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 953820ad44256775bfec7869f5ed4619f9760392
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sun Dec 15 04:43:53 2002 +0000
Fix for 3016385, menus on webreference.com don't show up.
Fixes to make webreference.com menus show up. This involved
fixing layers to not clip positioned objects when overflow:hidden
is set, fixing the stupid clip/sync layout hack for livepage
so that it doesn't break webreference, and implementing
navigator.productSub (right now the date is set to
Christmas 2002).
Reviewed by gramps/maciej.
* khtml/ecma/kjs_navigator.cpp:
(Navigator::getValueProperty):
* khtml/ecma/kjs_navigator.h:
* khtml/ecma/kjs_navigator.lut.h:
* khtml/rendering/render_box.cpp:
(RenderBox::getOverflowClipRect):
* khtml/rendering/render_box.h:
* khtml/rendering/render_flow.cpp:
(RenderFlow::layout):
* khtml/rendering/render_layer.cpp:
(RenderLayer::paint):
(RenderLayer::nodeAtPoint):
(RenderLayer::constructZTree):
* khtml/rendering/render_layer.h:
* khtml/rendering/render_object.cpp:
(RenderObject::setLayouted):
* khtml/rendering/render_object.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3054 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 51eed9c..a30ede0 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,34 @@
+2002-12-14 David Hyatt <hyatt at apple.com>
+
+ Fix for 3016385, menus on webreference.com don't show up.
+
+ Fixes to make webreference.com menus show up. This involved
+ fixing layers to not clip positioned objects when overflow:hidden
+ is set, fixing the stupid clip/sync layout hack for livepage
+ so that it doesn't break webreference, and implementing
+ navigator.productSub (right now the date is set to
+ Christmas 2002).
+
+ Reviewed by gramps/maciej.
+
+ * khtml/ecma/kjs_navigator.cpp:
+ (Navigator::getValueProperty):
+ * khtml/ecma/kjs_navigator.h:
+ * khtml/ecma/kjs_navigator.lut.h:
+ * khtml/rendering/render_box.cpp:
+ (RenderBox::getOverflowClipRect):
+ * khtml/rendering/render_box.h:
+ * khtml/rendering/render_flow.cpp:
+ (RenderFlow::layout):
+ * khtml/rendering/render_layer.cpp:
+ (RenderLayer::paint):
+ (RenderLayer::nodeAtPoint):
+ (RenderLayer::constructZTree):
+ * khtml/rendering/render_layer.h:
+ * khtml/rendering/render_object.cpp:
+ (RenderObject::setLayouted):
+ * khtml/rendering/render_object.h:
+
2002-12-14 Ken Kocienda <kocienda at apple.com>
Reviewed by Maciej
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 51eed9c..a30ede0 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,34 @@
+2002-12-14 David Hyatt <hyatt at apple.com>
+
+ Fix for 3016385, menus on webreference.com don't show up.
+
+ Fixes to make webreference.com menus show up. This involved
+ fixing layers to not clip positioned objects when overflow:hidden
+ is set, fixing the stupid clip/sync layout hack for livepage
+ so that it doesn't break webreference, and implementing
+ navigator.productSub (right now the date is set to
+ Christmas 2002).
+
+ Reviewed by gramps/maciej.
+
+ * khtml/ecma/kjs_navigator.cpp:
+ (Navigator::getValueProperty):
+ * khtml/ecma/kjs_navigator.h:
+ * khtml/ecma/kjs_navigator.lut.h:
+ * khtml/rendering/render_box.cpp:
+ (RenderBox::getOverflowClipRect):
+ * khtml/rendering/render_box.h:
+ * khtml/rendering/render_flow.cpp:
+ (RenderFlow::layout):
+ * khtml/rendering/render_layer.cpp:
+ (RenderLayer::paint):
+ (RenderLayer::nodeAtPoint):
+ (RenderLayer::constructZTree):
+ * khtml/rendering/render_layer.h:
+ * khtml/rendering/render_object.cpp:
+ (RenderObject::setLayouted):
+ * khtml/rendering/render_object.h:
+
2002-12-14 Ken Kocienda <kocienda at apple.com>
Reviewed by Maciej
diff --git a/WebCore/khtml/ecma/kjs_navigator.cpp b/WebCore/khtml/ecma/kjs_navigator.cpp
index 8d10c72..74ce6c6 100644
--- a/WebCore/khtml/ecma/kjs_navigator.cpp
+++ b/WebCore/khtml/ecma/kjs_navigator.cpp
@@ -147,7 +147,7 @@ int KJS::PluginBase::m_refCount = 0;
const ClassInfo Navigator::info = { "Navigator", 0, &NavigatorTable, 0 };
/*
- at begin NavigatorTable 11
+ at begin NavigatorTable 13
appCodeName Navigator::AppCodeName DontDelete|ReadOnly
appName Navigator::AppName DontDelete|ReadOnly
appVersion Navigator::AppVersion DontDelete|ReadOnly
@@ -157,6 +157,7 @@ const ClassInfo Navigator::info = { "Navigator", 0, &NavigatorTable, 0 };
plugins Navigator::_Plugins DontDelete|ReadOnly
mimeTypes Navigator::_MimeTypes DontDelete|ReadOnly
product Navigator::Product DontDelete|ReadOnly
+ productSub Navigator::ProductSub DontDelete|ReadOnly
vendor Navigator::Vendor DontDelete|ReadOnly
cookieEnabled Navigator::CookieEnabled DontDelete|ReadOnly
javaEnabled Navigator::JavaEnabled DontDelete|Function 0
@@ -223,6 +224,8 @@ Value Navigator::getValueProperty(ExecState *exec, int token) const
#else
return String("Konqueror/khtml");
#endif
+ case ProductSub:
+ return String("20021225");
case Vendor:
#if APPLE_CHANGES
// FIXME: Should we define a fallback result here besides "KDE"? Perhaps "Apple"?
diff --git a/WebCore/khtml/ecma/kjs_navigator.h b/WebCore/khtml/ecma/kjs_navigator.h
index 5a930ec..bbb4940 100644
--- a/WebCore/khtml/ecma/kjs_navigator.h
+++ b/WebCore/khtml/ecma/kjs_navigator.h
@@ -35,7 +35,7 @@ namespace KJS {
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { AppCodeName, AppName, AppVersion, Language, UserAgent, Platform,
- _Plugins, _MimeTypes, Product, Vendor, CookieEnabled, JavaEnabled };
+ _Plugins, _MimeTypes, Product, ProductSub, Vendor, CookieEnabled, JavaEnabled };
KHTMLPart *part() const { return m_part; }
private:
KHTMLPart *m_part;
diff --git a/WebCore/khtml/ecma/kjs_navigator.lut.h b/WebCore/khtml/ecma/kjs_navigator.lut.h
index e18ee0b..95fe528 100644
--- a/WebCore/khtml/ecma/kjs_navigator.lut.h
+++ b/WebCore/khtml/ecma/kjs_navigator.lut.h
@@ -3,24 +3,25 @@
namespace KJS {
const struct HashEntry NavigatorTableEntries[] = {
- { "language", Navigator::Language, DontDelete|ReadOnly, 0, &NavigatorTableEntries[13] },
- { "javaEnabled", Navigator::JavaEnabled, DontDelete|Function, 0, 0 },
- { "appName", Navigator::AppName, DontDelete|ReadOnly, 0, 0 },
{ 0, 0, 0, 0, 0 },
+ { "productSub", Navigator::ProductSub, DontDelete|ReadOnly, 0, 0 },
+ { "product", Navigator::Product, DontDelete|ReadOnly, 0, 0 },
+ { "plugins", Navigator::_Plugins, DontDelete|ReadOnly, 0, 0 },
+ { "appName", Navigator::AppName, DontDelete|ReadOnly, 0, &NavigatorTableEntries[13] },
{ 0, 0, 0, 0, 0 },
- { "vendor", Navigator::Vendor, DontDelete|ReadOnly, 0, 0 },
+ { "appCodeName", Navigator::AppCodeName, DontDelete|ReadOnly, 0, &NavigatorTableEntries[14] },
{ 0, 0, 0, 0, 0 },
- { "appCodeName", Navigator::AppCodeName, DontDelete|ReadOnly, 0, &NavigatorTableEntries[11] },
- { "cookieEnabled", Navigator::CookieEnabled, DontDelete|ReadOnly, 0, 0 },
+ { "mimeTypes", Navigator::_MimeTypes, DontDelete|ReadOnly, 0, 0 },
+ { "javaEnabled", Navigator::JavaEnabled, DontDelete|Function, 0, 0 },
+ { "appVersion", Navigator::AppVersion, DontDelete|ReadOnly, 0, 0 },
+ { "platform", Navigator::Platform, DontDelete|ReadOnly, 0, 0 },
{ 0, 0, 0, 0, 0 },
- { "product", Navigator::Product, DontDelete|ReadOnly, 0, 0 },
- { "appVersion", Navigator::AppVersion, DontDelete|ReadOnly, 0, &NavigatorTableEntries[12] },
+ { "language", Navigator::Language, DontDelete|ReadOnly, 0, &NavigatorTableEntries[15] },
{ "userAgent", Navigator::UserAgent, DontDelete|ReadOnly, 0, 0 },
- { "platform", Navigator::Platform, DontDelete|ReadOnly, 0, &NavigatorTableEntries[14] },
- { "plugins", Navigator::_Plugins, DontDelete|ReadOnly, 0, &NavigatorTableEntries[15] },
- { "mimeTypes", Navigator::_MimeTypes, DontDelete|ReadOnly, 0, 0 }
+ { "vendor", Navigator::Vendor, DontDelete|ReadOnly, 0, &NavigatorTableEntries[16] },
+ { "cookieEnabled", Navigator::CookieEnabled, DontDelete|ReadOnly, 0, 0 }
};
-const struct HashTable NavigatorTable = { 2, 16, NavigatorTableEntries, 11 };
+const struct HashTable NavigatorTable = { 2, 17, NavigatorTableEntries, 13 };
}; // namespace
diff --git a/WebCore/khtml/rendering/render_box.cpp b/WebCore/khtml/rendering/render_box.cpp
index be791d2..c578816 100644
--- a/WebCore/khtml/rendering/render_box.cpp
+++ b/WebCore/khtml/rendering/render_box.cpp
@@ -342,6 +342,18 @@ void RenderBox::outlineBox(QPainter *p, int _tx, int _ty, const char *color)
p->drawRect(_tx, _ty, m_width, m_height);
}
+QRect RenderBox::getOverflowClipRect(int tx, int ty)
+{
+ // XXX When overflow-clip (CSS3) is implemented, we'll obtain the property
+ // here.
+ int bl=borderLeft(),bt=borderTop(),bb=borderBottom(),br=borderRight();
+ int clipx = tx+bl;
+ int clipy = ty+bt;
+ int clipw = m_width-bl-br;
+ int cliph = m_height-bt-bb;
+
+ return QRect(clipx,clipy,clipw,cliph);
+}
QRect RenderBox::getClipRect(int tx, int ty)
{
diff --git a/WebCore/khtml/rendering/render_box.h b/WebCore/khtml/rendering/render_box.h
index e672269..55a7586 100644
--- a/WebCore/khtml/rendering/render_box.h
+++ b/WebCore/khtml/rendering/render_box.h
@@ -121,6 +121,7 @@ protected:
void calcAbsoluteHorizontal();
void calcAbsoluteVertical();
+ virtual QRect getOverflowClipRect(int tx, int ty);
virtual QRect getClipRect(int tx, int ty);
// the actual height of the contents + borders + padding
diff --git a/WebCore/khtml/rendering/render_flow.cpp b/WebCore/khtml/rendering/render_flow.cpp
index 6349965..1ec2a01 100644
--- a/WebCore/khtml/rendering/render_flow.cpp
+++ b/WebCore/khtml/rendering/render_flow.cpp
@@ -332,12 +332,6 @@ void RenderFlow::layout()
m_overflowHeight = m_height;
}
- // overflow:hidden will just clip, so we don't have overflow.
- if (style()->overflow()==OHIDDEN) {
- m_overflowHeight = m_height;
- m_overflowWidth = m_width;
- }
-
if (isTableCell()) {
// Table cells need to grow to accommodate both overhanging floats and
// blocks that have overflowed content.
@@ -378,7 +372,13 @@ void RenderFlow::layout()
// Always ensure our overflow width is at least as large as our width.
if (m_overflowWidth < m_width)
m_overflowWidth = m_width;
-
+
+ // overflow:hidden will just clip, so we don't have overflow.
+ if (style()->overflow()==OHIDDEN) {
+ m_overflowHeight = m_height;
+ m_overflowWidth = m_width;
+ }
+
setLayouted();
}
diff --git a/WebCore/khtml/rendering/render_layer.cpp b/WebCore/khtml/rendering/render_layer.cpp
index fc448cc..feaa46d 100644
--- a/WebCore/khtml/rendering/render_layer.cpp
+++ b/WebCore/khtml/rendering/render_layer.cpp
@@ -179,7 +179,8 @@ void
RenderLayer::paint(QPainter *p, int x, int y, int w, int h)
{
// Create the z-tree of layers that should be displayed.
- RenderLayer::RenderZTreeNode* node = constructZTree(QRect(x, y, w, h), this);
+ QRect damageRect = QRect(x,y,w,h);
+ RenderLayer::RenderZTreeNode* node = constructZTree(damageRect, damageRect, this);
if (!node)
return;
@@ -258,8 +259,7 @@ RenderLayer::paint(QPainter *p, int x, int y, int w, int h)
#endif
}
}
-
- // Paint the layer.
+
elt->layer->renderer()->paint(p, x, y, w, h,
elt->absBounds.x() - elt->layer->renderer()->xPos(),
elt->absBounds.y() - elt->layer->renderer()->yPos(),
@@ -284,7 +284,8 @@ bool
RenderLayer::nodeAtPoint(RenderObject::NodeInfo& info, int x, int y)
{
bool inside = false;
- RenderLayer::RenderZTreeNode* node = constructZTree(QRect(x, y, 0, 0), this, true);
+ QRect damageRect = QRect(x,y,0,0);
+ RenderLayer::RenderZTreeNode* node = constructZTree(damageRect, damageRect, this, true);
if (!node)
return false;
@@ -315,7 +316,7 @@ RenderLayer::nodeAtPoint(RenderObject::NodeInfo& info, int x, int y)
}
RenderLayer::RenderZTreeNode*
-RenderLayer::constructZTree(QRect damageRect,
+RenderLayer::constructZTree(QRect overflowClipRect, QRect posClipRect,
RenderLayer* rootLayer,
bool eventProcessing)
{
@@ -334,10 +335,9 @@ RenderLayer::constructZTree(QRect damageRect,
// damage rect and avoid repainting the layer if it falls outside that rect.
// An exception to this rule is the root layer, which always paints (hence the
// m_parent null check below).
- if (!m_object->isPositioned())
- updateLayerPosition(); // For relpositioned layers or non-positioned layers,
- // we need to keep in sync, since we may have shifted relative
- // to our parent layer.
+ updateLayerPosition(); // For relpositioned layers or non-positioned layers,
+ // we need to keep in sync, since we may have shifted relative
+ // to our parent layer.
int x = 0;
int y = 0;
@@ -346,22 +346,32 @@ RenderLayer::constructZTree(QRect damageRect,
returnNode = new (renderArena) RenderZTreeNode(this);
+ // Positioned elements are clipped according to the posClipRect. All other
+ // layers are clipped according to the overflowClipRect.
+ QRect clipRectToApply = m_object->isPositioned() ? posClipRect : overflowClipRect;
+ QRect damageRect = eventProcessing ? clipRectToApply :
+ clipRectToApply.intersect(QRect(x,y,m_object->width(), m_object->height()));
+
// If we establish a clip rect, then we want to intersect that rect
// with the damage rect to form a new damage rect.
bool clipOriginator = false;
- QRect clipRect = damageRect;
- if (m_object->style()->overflow() == OHIDDEN || m_object->style()->hasClip()) {
+
+ // Update the clip rects that will be passed to children layers.
+ if (m_object->hasOverflowClip() || m_object->hasClip()) {
+ // This layer establishes a clip of some kind.
clipOriginator = true;
- QRect backgroundRect(x,y,m_object->width(), m_object->height());
- clipRect = m_object->getClipRect(x, y);
- if ((eventProcessing && !backgroundRect.contains(damageRect.x(),
- damageRect.y())) ||
- (!eventProcessing && !backgroundRect.intersects(damageRect)))
- return 0; // We don't overlap at all.
-
- if (!eventProcessing) {
- damageRect = damageRect.intersect(backgroundRect);
- clipRect = damageRect.intersect(clipRect);
+ if (m_object->hasOverflowClip()) {
+ QRect newOverflowClip = m_object->getOverflowClipRect(x,y);
+ overflowClipRect = newOverflowClip.intersect(overflowClipRect);
+ clipRectToApply = clipRectToApply.intersect(newOverflowClip);
+ }
+ if (m_object->hasClip()) {
+ QRect newPosClip = m_object->getClipRect(x,y);
+ if (m_object->hasOverflowClip())
+ newPosClip = newPosClip.intersect(m_object->getOverflowClipRect(x,y));
+ posClipRect = newPosClip.intersect(posClipRect);
+ overflowClipRect = overflowClipRect.intersect(posClipRect);
+ clipRectToApply = clipRectToApply.intersect(newPosClip);
}
}
@@ -372,7 +382,8 @@ RenderLayer::constructZTree(QRect damageRect,
if (child->zIndex() < 0)
continue; // Ignore negative z-indices in this first pass.
- RenderZTreeNode* childNode = child->constructZTree(clipRect, rootLayer, eventProcessing);
+ RenderZTreeNode* childNode = child->constructZTree(overflowClipRect, posClipRect,
+ rootLayer, eventProcessing);
if (childNode) {
// Put the new node into the tree at the front of the parent's list.
if (lastChildNode)
@@ -395,7 +406,8 @@ RenderLayer::constructZTree(QRect damageRect,
damageRect.y())) ||
(!eventProcessing && layerBounds.intersects(damageRect))) {
RenderLayerElement* layerElt = new (renderArena) RenderLayerElement(this, layerBounds,
- damageRect, clipRect, clipOriginator, x, y);
+ damageRect, clipRectToApply,
+ clipOriginator, x, y);
if (returnNode->child) {
RenderZTreeNode* leaf = new (renderArena) RenderZTreeNode(layerElt);
leaf->next = returnNode->child;
@@ -416,7 +428,8 @@ RenderLayer::constructZTree(QRect damageRect,
if (child->zIndex() >= 0)
continue; // Ignore non-negative z-indices in this second pass.
- RenderZTreeNode* childNode = child->constructZTree(clipRect, rootLayer, eventProcessing);
+ RenderZTreeNode* childNode = child->constructZTree(overflowClipRect, posClipRect,
+ rootLayer, eventProcessing);
if (childNode) {
// Deal with the case where all our children views had negative z-indices.
// Demote our leaf node and make a new interior node that can hold these
diff --git a/WebCore/khtml/rendering/render_layer.h b/WebCore/khtml/rendering/render_layer.h
index 6b01181..810e605 100644
--- a/WebCore/khtml/rendering/render_layer.h
+++ b/WebCore/khtml/rendering/render_layer.h
@@ -213,7 +213,7 @@ public:
};
private:
- // The createZTree function creates a z-tree for a given layer hierarchy
+ // The constructZTree function creates a z-tree for a given layer hierarchy
// rooted on this layer. It will ensure that immediate child
// elements of a given z-tree node are at least initially sorted
// into <negative z-index children>, <this layer>, <non-negative z-index
@@ -240,7 +240,8 @@ private:
// +-------> L(L5)
// +-------> L(L6)
//
- RenderZTreeNode* constructZTree(QRect damageRect,
+ RenderZTreeNode* constructZTree(QRect overflowClipRect,
+ QRect clipRect,
RenderLayer* rootLayer,
bool eventProcessing = false);
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index 30529db..11a62a0 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -281,7 +281,22 @@ void RenderObject::setLayouted(bool b)
RenderObject *root = this;
bool rootAlreadyNeedsLayout = false;
- RenderObject* clippedObj = (style()->overflow() == OHIDDEN) ? this : 0;
+ RenderObject* clippedObj =
+ (style()->overflow() == OHIDDEN && !isText()) ? this : 0;
+
+ if (clippedObj) {
+ // Update our hack for positioned objects. It doesn't work because
+ // this can be called from setStyle. This whole clip hack is evil and must die. -dwh
+ bool positioned = style()->position() == ABSOLUTE ||
+ style()->position() == FIXED;
+ bool relpositioned = style()->position() == RELATIVE;
+ if (positioned && !isPositioned()) {
+ setPositioned(true);
+ setInline(false);
+ }
+ else if (relpositioned && !isRelPositioned())
+ setRelPositioned(true);
+ }
while( o ) {
root = o;
@@ -298,11 +313,11 @@ void RenderObject::setLayouted(bool b)
root->layout();
clippedObj->repaint();
gClipObject = 0;
+ m_layouted = true;
}
else
root->scheduleRelayout();
}
-
}
}
diff --git a/WebCore/khtml/rendering/render_object.h b/WebCore/khtml/rendering/render_object.h
index 7f627e8..d995998 100644
--- a/WebCore/khtml/rendering/render_object.h
+++ b/WebCore/khtml/rendering/render_object.h
@@ -109,7 +109,10 @@ public:
virtual void setHasChildLayers(bool hasLayers) { }
virtual void positionChildLayers() { }
+ virtual QRect getOverflowClipRect(int tx, int ty) { return QRect(0,0,0,0); }
virtual QRect getClipRect(int tx, int ty) { return QRect(0,0,0,0); }
+ bool hasClip() { return isPositioned() && style()->hasClip(); }
+ bool hasOverflowClip() { return style()->overflow() == OHIDDEN; }
// RenderObject tree manipulation
//////////////////////////////////////////
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list