[webkit-changes] cvs commit: WebCore/kwq KWQKHTMLPart.mm
Timothy
thatcher at opensource.apple.com
Mon Dec 12 16:21:34 PST 2005
thatcher 05/12/12 16:21:34
Modified: . Tag: Safari-1-3-branch ChangeLog
khtml/dom Tag: Safari-1-3-branch dom_element.cpp
khtml/xml Tag: Safari-1-3-branch dom_docimpl.cpp
dom_elementimpl.cpp dom_elementimpl.h
kwq Tag: Safari-1-3-branch KWQKHTMLPart.mm
Log:
Merged fix from TOT to Safari-1-3-branch
2005-12-08 Adele Peterson <adele at apple.com>
Reviewed by Tim Hatcher.
- fixed <rdar://problem/4363794> 10.4.4 REGRESSION: Page scroll position jumps when clicking on word in editable div (5911)
setFocusNode was trying to scroll to reveal elements unnecessarily.
Now the callers have to decide whether or not to scroll.
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::setFocusNode): No longer calls scrolling code.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::nextKeyViewInFrame): Now calls scrolling code after setting the focus node.
* khtml/xml/dom_elementimpl.cpp:
(ElementImpl::focus): Moved functionality from Element::focus.
Now these functions also call scrolling code.
(ElementImpl::blur): ditto.
* khtml/xml/dom_elementimpl.h: Added focus and blur.
* khtml/dom/dom_element.cpp:
(Element::focus): Now calls ElementImpl::focus
(Element::blur): ditto.
Revision Changes Path
No revision
No revision
1.335.2.54 +25 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.335.2.53
retrieving revision 1.335.2.54
diff -u -r1.335.2.53 -r1.335.2.54
--- ChangeLog 13 Dec 2005 00:12:21 -0000 1.335.2.53
+++ ChangeLog 13 Dec 2005 00:21:18 -0000 1.335.2.54
@@ -2,6 +2,31 @@
Merged fix from TOT to Safari-1-3-branch
+ 2005-12-08 Adele Peterson <adele at apple.com>
+
+ Reviewed by Tim Hatcher.
+
+ - fixed <rdar://problem/4363794> 10.4.4 REGRESSION: Page scroll position jumps when clicking on word in editable div (5911)
+ setFocusNode was trying to scroll to reveal elements unnecessarily.
+ Now the callers have to decide whether or not to scroll.
+
+ * khtml/xml/dom_docimpl.cpp:
+ (DocumentImpl::setFocusNode): No longer calls scrolling code.
+ * kwq/KWQKHTMLPart.mm:
+ (KWQKHTMLPart::nextKeyViewInFrame): Now calls scrolling code after setting the focus node.
+ * khtml/xml/dom_elementimpl.cpp:
+ (ElementImpl::focus): Moved functionality from Element::focus.
+ Now these functions also call scrolling code.
+ (ElementImpl::blur): ditto.
+ * khtml/xml/dom_elementimpl.h: Added focus and blur.
+ * khtml/dom/dom_element.cpp:
+ (Element::focus): Now calls ElementImpl::focus
+ (Element::blur): ditto.
+
+2005-12-12 Timothy Hatcher <timothy at apple.com>
+
+ Merged fix from TOT to Safari-1-3-branch
+
2005-12-08 David Harrison <harrison at apple.com>
Reviewed by Geoff.
No revision
No revision
1.9.16.2 +2 -6 WebCore/khtml/dom/Attic/dom_element.cpp
Index: dom_element.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/dom/Attic/dom_element.cpp,v
retrieving revision 1.9.16.1
retrieving revision 1.9.16.2
diff -u -r1.9.16.1 -r1.9.16.2
--- dom_element.cpp 16 Nov 2005 00:10:59 -0000 1.9.16.1
+++ dom_element.cpp 13 Dec 2005 00:21:26 -0000 1.9.16.2
@@ -297,17 +297,13 @@
void Element::focus()
{
if(!impl) return;
- DocumentImpl* doc = impl->getDocument();
- if (doc && impl->isFocusable())
- doc->setFocusNode(impl);
+ ((ElementImpl *)impl)->focus();
}
void Element::blur()
{
if(!impl) return;
- DocumentImpl* doc = impl->getDocument();
- if (doc && doc->focusNode() == impl)
- doc->setFocusNode(0);
+ ((ElementImpl *)impl)->blur();
}
// FIXME: This should move down to HTMLElement.
No revision
No revision
1.211.4.15 +1 -7 WebCore/khtml/xml/dom_docimpl.cpp
Index: dom_docimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_docimpl.cpp,v
retrieving revision 1.211.4.14
retrieving revision 1.211.4.15
diff -u -r1.211.4.14 -r1.211.4.15
--- dom_docimpl.cpp 30 Nov 2005 22:39:54 -0000 1.211.4.14
+++ dom_docimpl.cpp 13 Dec 2005 00:21:26 -0000 1.211.4.15
@@ -2660,14 +2660,8 @@
}
if (focusWidget)
focusWidget->setFocus();
- else {
+ else
view()->setFocus();
- // updateLayout in case this comes before a renderer is set up.
- updateLayout();
- // Check that there's still a renderer after updating the layout.
- if (m_focusNode->renderer())
- m_focusNode->renderer()->enclosingLayer()->scrollRectToVisible(m_focusNode->getRect());
- }
}
}
1.61.4.2 +17 -0 WebCore/khtml/xml/dom_elementimpl.cpp
Index: dom_elementimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_elementimpl.cpp,v
retrieving revision 1.61.4.1
retrieving revision 1.61.4.2
diff -u -r1.61.4.1 -r1.61.4.2
--- dom_elementimpl.cpp 12 Jul 2005 21:18:10 -0000 1.61.4.1
+++ dom_elementimpl.cpp 13 Dec 2005 00:21:28 -0000 1.61.4.2
@@ -258,6 +258,23 @@
return nullAtom;
}
+void ElementImpl::focus()
+{
+ DocumentImpl *doc = getDocument();
+ if (doc)
+ doc->updateLayout();
+ if (isFocusable() && renderer()) {
+ renderer()->enclosingLayer()->scrollRectToVisible(getRect());
+ }
+}
+
+void ElementImpl::blur()
+{
+ DocumentImpl* doc = getDocument();
+ if (doc && doc->focusNode() == this)
+ doc->setFocusNode(0);
+}
+
const AtomicString& ElementImpl::getAttributeNS(const DOMString &namespaceURI,
const DOMString &localName) const
{
1.35.6.2 +3 -0 WebCore/khtml/xml/dom_elementimpl.h
Index: dom_elementimpl.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_elementimpl.h,v
retrieving revision 1.35.6.1
retrieving revision 1.35.6.2
diff -u -r1.35.6.1 -r1.35.6.2
--- dom_elementimpl.h 12 Jul 2005 21:18:10 -0000 1.35.6.1
+++ dom_elementimpl.h 13 Dec 2005 00:21:28 -0000 1.35.6.2
@@ -168,6 +168,9 @@
void removeAttribute( NodeImpl::Id id, int &exceptioncode );
bool hasAttributes() const;
+ void focus();
+ void blur();
+
DOMString prefix() const { return m_prefix; }
void setPrefix(const DOMString &_prefix, int &exceptioncode );
No revision
No revision
1.628.4.6 +3 -3 WebCore/kwq/KWQKHTMLPart.mm
Index: KWQKHTMLPart.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQKHTMLPart.mm,v
retrieving revision 1.628.4.5
retrieving revision 1.628.4.6
diff -u -r1.628.4.5 -r1.628.4.6
--- KWQKHTMLPart.mm 13 Dec 2005 00:12:30 -0000 1.628.4.5
+++ KWQKHTMLPart.mm 13 Dec 2005 00:21:31 -0000 1.628.4.6
@@ -1159,10 +1159,10 @@
}
}
else {
- doc->setFocusNode(node);
- if (node->renderer())
+ if (node->isFocusable() && node->renderer()) {
+ doc->setFocusNode(node);
node->renderer()->enclosingLayer()->scrollRectToVisible(node->getRect());
-
+ }
[_bridge makeFirstResponder:[_bridge documentView]];
return [_bridge documentView];
}
More information about the webkit-changes
mailing list