[webkit-changes] cvs commit: WebCore/khtml khtml_part.cpp
Timothy
thatcher at opensource.apple.com
Mon Dec 12 16:05:31 PST 2005
thatcher 05/12/12 16:05:30
Modified: . Tag: Safari-1-3-branch ChangeLog
khtml Tag: Safari-1-3-branch khtml_part.cpp
Log:
Merged fix from TOT to Safari-1-3-branch
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):
Revision Changes Path
No revision
No revision
1.335.2.52 +13 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.335.2.51
retrieving revision 1.335.2.52
diff -u -r1.335.2.51 -r1.335.2.52
--- ChangeLog 12 Dec 2005 23:53:57 -0000 1.335.2.51
+++ ChangeLog 13 Dec 2005 00:05:20 -0000 1.335.2.52
@@ -2,6 +2,19 @@
Merged fix from TOT to Safari-1-3-branch
+ 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):
+2005-12-12 Timothy Hatcher <timothy at apple.com>
+
+ Merged fix from TOT to Safari-1-3-branch
+
2005-12-09 Tim Omernick <timo at apple.com>
Reviewed by Darin.
No revision
No revision
1.311.6.10 +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.6.9
retrieving revision 1.311.6.10
diff -u -r1.311.6.9 -r1.311.6.10
--- khtml_part.cpp 18 Nov 2005 22:46:23 -0000 1.311.6.9
+++ khtml_part.cpp 13 Dec 2005 00:05:27 -0000 1.311.6.10
@@ -2264,10 +2264,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