[webkit-changes] cvs commit: WebCore/khtml khtml_part.cpp
Adele
adele at opensource.apple.com
Mon Dec 12 11:07:11 PST 2005
adele 05/12/12 11:07:11
Modified: . Tag: Safari-2-0-branch ChangeLog
khtml Tag: Safari-2-0-branch khtml_part.cpp
Log:
Reviewed by Dave Harrison.
- fixed <rdar://problem/4374673> Regression: Safari fails to scroll to top of page if (name="top") attribute is not present
When there's no node corresponding to the anchor (the name is empty or "top"), we still want to scroll to the top of the document. This got left out in the conversion to the new scrolling code.
* khtml/khtml_part.cpp: (KHTMLPart::gotoAnchor):
Revision Changes Path
No revision
No revision
1.1.2.100 +10 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.1.2.99
retrieving revision 1.1.2.100
diff -u -r1.1.2.99 -r1.1.2.100
--- ChangeLog 9 Dec 2005 22:06:31 -0000 1.1.2.99
+++ ChangeLog 12 Dec 2005 19:07:01 -0000 1.1.2.100
@@ -1,3 +1,13 @@
+2005-12-12 Adele Peterson <adele at apple.com>
+
+ Reviewed by Dave Harrison.
+
+ - fixed <rdar://problem/4374673> Regression: Safari fails to scroll to top of page if (name="top") attribute is not present
+
+ When there's no node corresponding to the anchor (the name is empty or "top"), we still want to scroll to the top of the document. This got left out in the conversion to the new scrolling code.
+
+ * khtml/khtml_part.cpp: (KHTMLPart::gotoAnchor):
+
=== WebCore-417.11 ===
2005-12-08 Adele Peterson <adele at apple.com>
No revision
No revision
1.311.8.16 +14 -3 WebCore/khtml/khtml_part.cpp
Index: khtml_part.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/khtml_part.cpp,v
retrieving revision 1.311.8.15
retrieving revision 1.311.8.16
diff -u -r1.311.8.15 -r1.311.8.16
--- khtml_part.cpp 18 Nov 2005 22:41:44 -0000 1.311.8.15
+++ khtml_part.cpp 12 Dec 2005 19:07:09 -0000 1.311.8.16
@@ -2269,10 +2269,21 @@
#if APPLE_CHANGES
// Scroll nested layers and frames to reveal the anchor.
- if (n && n->renderer()) {
+ RenderObject *renderer;
+ QRect rect;
+ if (n) {
+ renderer = n->renderer();
+ rect = n->getRect();
+ } else {
+ // If there's no node, we should scroll to the top of the document.
+ renderer = d->m_doc->renderer();
+ rect = QRect();
+ }
+
+ if (renderer) {
// Align to the top and to the closest side (this matches other browsers).
- n->renderer()->enclosingLayer()->scrollRectToVisible(n->getRect(), RenderLayer::gAlignToEdgeIfNeeded, RenderLayer::gAlignTopAlways);
- }
+ renderer->enclosingLayer()->scrollRectToVisible(rect, RenderLayer::gAlignToEdgeIfNeeded, RenderLayer::gAlignTopAlways);
+ }
#else
d->m_view->setContentsPos(x, y);
#endif
More information about the webkit-changes
mailing list