[webkit-changes] cvs commit: WebCore/khtml/xml dom_docimpl.cpp
dom_docimpl.h
Adele
adele at opensource.apple.com
Fri Jul 1 15:36:05 PDT 2005
adele 05/07/01 15:36:04
Modified: . Tag: Safari-2-0-branch ChangeLog
khtml/dom Tag: Safari-2-0-branch dom_doc.cpp dom_doc.h
khtml/ecma Tag: Safari-2-0-branch kjs_dom.cpp kjs_dom.h
kjs_dom.lut.h
khtml/xml Tag: Safari-2-0-branch dom_docimpl.cpp
dom_docimpl.h
Log:
Merged fix from TOT to Safari-2-0-branch.
<rdar://problem/4164922> Request for including an implementation of the elementFromPoint function
2005-04-12 Vicki Murley <vicki at apple.com>
Reviewed by Maciej.
- fixed <rdar://problem/3760895> Request for including an implementation of the elementFromPoint function
* khtml/dom/dom_doc.cpp:
(DOM::Document::elementFromPoint):
* khtml/dom/dom_doc.h:
* khtml/ecma/kjs_dom.cpp:
(DOMDocumentProtoFunc::tryCall):
* khtml/ecma/kjs_dom.h:
(KJS::DOMDocument::):
* khtml/ecma/kjs_dom.lut.h:
(KJS::):
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::elementFromPoint):
* khtml/xml/dom_docimpl.h:
Revision Changes Path
No revision
No revision
1.4104.2.38 +24 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.4104.2.37
retrieving revision 1.4104.2.38
diff -u -r1.4104.2.37 -r1.4104.2.38
--- ChangeLog 28 Jun 2005 00:26:28 -0000 1.4104.2.37
+++ ChangeLog 1 Jul 2005 22:35:56 -0000 1.4104.2.38
@@ -1,3 +1,27 @@
+2005-07-01 Adele Peterson <adele at apple.com>
+
+ Merged fix from TOT to Safari-2-0-branch.
+ <rdar://problem/4164922> Request for including an implementation of the elementFromPoint function
+
+ 2005-04-12 Vicki Murley <vicki at apple.com>
+
+ Reviewed by Maciej.
+
+ - fixed <rdar://problem/3760895> Request for including an implementation of the elementFromPoint function
+
+ * khtml/dom/dom_doc.cpp:
+ (DOM::Document::elementFromPoint):
+ * khtml/dom/dom_doc.h:
+ * khtml/ecma/kjs_dom.cpp:
+ (DOMDocumentProtoFunc::tryCall):
+ * khtml/ecma/kjs_dom.h:
+ (KJS::DOMDocument::):
+ * khtml/ecma/kjs_dom.lut.h:
+ (KJS::):
+ * khtml/xml/dom_docimpl.cpp:
+ (DocumentImpl::elementFromPoint):
+ * khtml/xml/dom_docimpl.h:
+
=== WebCore-415.11.1 ===
2005-06-27 Adele Peterson <adele at apple.com>
No revision
No revision
1.17.14.1 +6 -0 WebCore/khtml/dom/dom_doc.cpp
Index: dom_doc.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/dom/dom_doc.cpp,v
retrieving revision 1.17
retrieving revision 1.17.14.1
diff -u -r1.17 -r1.17.14.1
--- dom_doc.cpp 4 Jun 2004 18:17:25 -0000 1.17
+++ dom_doc.cpp 1 Jul 2005 22:36:02 -0000 1.17.14.1
@@ -329,6 +329,12 @@
return 0;
}
+Element Document::elementFromPoint( const int _x, const int _y ) const
+{
+ if(!impl) return 0;
+ return ((DocumentImpl *)impl)->elementFromPoint( _x, _y );
+}
+
NodeList Document::getElementsByTagName( const DOMString &tagName )
{
if (!impl) return 0;
1.14.14.1 +2 -0 WebCore/khtml/dom/dom_doc.h
Index: dom_doc.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/dom/dom_doc.h,v
retrieving revision 1.14
retrieving revision 1.14.14.1
diff -u -r1.14 -r1.14.14.1
--- dom_doc.h 4 Jun 2004 18:17:25 -0000 1.14
+++ dom_doc.h 1 Jul 2005 22:36:02 -0000 1.14.14.1
@@ -485,6 +485,8 @@
*
*/
Element getElementById ( const DOMString &elementId ) const;
+
+ Element elementFromPoint ( const int _x, const int _y ) const;
/**
* No Exceptions.
No revision
No revision
1.66.6.7 +3 -0 WebCore/khtml/ecma/kjs_dom.cpp
Index: kjs_dom.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_dom.cpp,v
retrieving revision 1.66.6.6
retrieving revision 1.66.6.7
diff -u -r1.66.6.6 -r1.66.6.7
--- kjs_dom.cpp 7 Jun 2005 22:42:59 -0000 1.66.6.6
+++ kjs_dom.cpp 1 Jul 2005 22:36:03 -0000 1.66.6.7
@@ -857,6 +857,7 @@
createProcessingInstruction DOMDocument::CreateProcessingInstruction DontDelete|Function 1
createAttribute DOMDocument::CreateAttribute DontDelete|Function 1
createEntityReference DOMDocument::CreateEntityReference DontDelete|Function 1
+ elementFromPoint DOMDocument::ElementFromPoint DontDelete|Function 1
getElementsByTagName DOMDocument::GetElementsByTagName DontDelete|Function 1
importNode DOMDocument::ImportNode DontDelete|Function 2
createElementNS DOMDocument::CreateElementNS DontDelete|Function 2
@@ -1011,6 +1012,8 @@
return getDOMNode(exec,doc.createAttribute(s));
case DOMDocument::CreateEntityReference:
return getDOMNode(exec,doc.createEntityReference(args[0].toString(exec).string()));
+ case DOMDocument::ElementFromPoint:
+ return getDOMNode(exec,doc.elementFromPoint((int)args[0].toNumber(exec), (int)args[1].toNumber(exec)));
case DOMDocument::GetElementsByTagName:
return getDOMNodeList(exec,doc.getElementsByTagName(s));
case DOMDocument::ImportNode: // DOM2
1.34.6.4 +1 -1 WebCore/khtml/ecma/kjs_dom.h
Index: kjs_dom.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_dom.h,v
retrieving revision 1.34.6.3
retrieving revision 1.34.6.4
diff -u -r1.34.6.3 -r1.34.6.4
--- kjs_dom.h 31 May 2005 19:37:41 -0000 1.34.6.3
+++ kjs_dom.h 1 Jul 2005 22:36:03 -0000 1.34.6.4
@@ -126,7 +126,7 @@
CreateEntityReference, GetElementsByTagName, ImportNode, CreateElementNS,
CreateAttributeNS, GetElementsByTagNameNS, GetElementById,
CreateRange, CreateNodeIterator, CreateTreeWalker, DefaultView,
- CreateEvent, StyleSheets, PreferredStylesheetSet,
+ CreateEvent, ElementFromPoint, StyleSheets, PreferredStylesheetSet,
SelectedStylesheetSet, GetOverrideStyle, ReadyState,
ExecCommand, QueryCommandEnabled, QueryCommandIndeterm, QueryCommandState,
QueryCommandSupported, QueryCommandValue };
1.16.8.2 +8 -7 WebCore/khtml/ecma/Attic/kjs_dom.lut.h
Index: kjs_dom.lut.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/Attic/kjs_dom.lut.h,v
retrieving revision 1.16.8.1
retrieving revision 1.16.8.2
diff -u -r1.16.8.1 -r1.16.8.2
--- kjs_dom.lut.h 27 Apr 2005 00:58:14 -0000 1.16.8.1
+++ kjs_dom.lut.h 1 Jul 2005 22:36:03 -0000 1.16.8.2
@@ -146,24 +146,24 @@
const struct HashEntry DOMDocumentProtoTableEntries[] = {
{ 0, 0, 0, 0, 0 },
{ "createEntityReference", DOMDocument::CreateEntityReference, DontDelete|Function, 1, 0 },
- { "getElementById", DOMDocument::GetElementById, DontDelete|Function, 1, &DOMDocumentProtoTableEntries[34] },
+ { "getElementById", DOMDocument::GetElementById, DontDelete|Function, 1, &DOMDocumentProtoTableEntries[35] },
{ 0, 0, 0, 0, 0 },
- { "getElementsByTagName", DOMDocument::GetElementsByTagName, DontDelete|Function, 1, &DOMDocumentProtoTableEntries[31] },
+ { "getElementsByTagName", DOMDocument::GetElementsByTagName, DontDelete|Function, 1, &DOMDocumentProtoTableEntries[32] },
{ "queryCommandIndeterm", DOMDocument::QueryCommandIndeterm, DontDelete|Function, 1, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ "createElement", DOMDocument::CreateElement, DontDelete|Function, 1, 0 },
- { "queryCommandEnabled", DOMDocument::QueryCommandEnabled, DontDelete|Function, 1, &DOMDocumentProtoTableEntries[35] },
+ { "queryCommandEnabled", DOMDocument::QueryCommandEnabled, DontDelete|Function, 1, &DOMDocumentProtoTableEntries[36] },
{ "createAttribute", DOMDocument::CreateAttribute, DontDelete|Function, 1, 0 },
{ "createEvent", DOMDocument::CreateEvent, DontDelete|Function, 1, 0 },
{ 0, 0, 0, 0, 0 },
- { "importNode", DOMDocument::ImportNode, DontDelete|Function, 2, &DOMDocumentProtoTableEntries[33] },
+ { "importNode", DOMDocument::ImportNode, DontDelete|Function, 2, &DOMDocumentProtoTableEntries[34] },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ "createDocumentFragment", DOMDocument::CreateDocumentFragment, DontDelete|Function, 1, &DOMDocumentProtoTableEntries[29] },
- { "createTextNode", DOMDocument::CreateTextNode, DontDelete|Function, 1, &DOMDocumentProtoTableEntries[32] },
- { "createRange", DOMDocument::CreateRange, DontDelete|Function, 0, 0 },
+ { "createTextNode", DOMDocument::CreateTextNode, DontDelete|Function, 1, &DOMDocumentProtoTableEntries[33] },
+ { "elementFromPoint", DOMDocument::ElementFromPoint, DontDelete|Function, 1, &DOMDocumentProtoTableEntries[31] },
{ "createCDATASection", DOMDocument::CreateCDATASection, DontDelete|Function, 1, &DOMDocumentProtoTableEntries[30] },
{ 0, 0, 0, 0, 0 },
{ "execCommand", DOMDocument::ExecCommand, DontDelete|Function, 3, 0 },
@@ -175,6 +175,7 @@
{ "getOverrideStyle", DOMDocument::GetOverrideStyle, DontDelete|Function, 2, 0 },
{ "createComment", DOMDocument::CreateComment, DontDelete|Function, 1, 0 },
{ "getElementsByTagNameNS", DOMDocument::GetElementsByTagNameNS, DontDelete|Function, 2, 0 },
+ { "createRange", DOMDocument::CreateRange, DontDelete|Function, 0, 0 },
{ "createNodeIterator", DOMDocument::CreateNodeIterator, DontDelete|Function, 3, 0 },
{ "createTreeWalker", DOMDocument::CreateTreeWalker, DontDelete|Function, 4, 0 },
{ "queryCommandState", DOMDocument::QueryCommandState, DontDelete|Function, 1, 0 },
@@ -182,7 +183,7 @@
{ "queryCommandValue", DOMDocument::QueryCommandValue, DontDelete|Function, 1, 0 }
};
-const struct HashTable DOMDocumentProtoTable = { 2, 36, DOMDocumentProtoTableEntries, 29 };
+const struct HashTable DOMDocumentProtoTable = { 2, 37, DOMDocumentProtoTableEntries, 29 };
} // namespace
No revision
No revision
1.211.6.4 +14 -0 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.6.3
retrieving revision 1.211.6.4
diff -u -r1.211.6.3 -r1.211.6.4
--- dom_docimpl.cpp 3 Jun 2005 21:11:45 -0000 1.211.6.3
+++ dom_docimpl.cpp 1 Jul 2005 22:36:03 -0000 1.211.6.4
@@ -632,6 +632,20 @@
return m_elementsById.find(elementId.string());
}
+ElementImpl *DocumentImpl::elementFromPoint( const int _x, const int _y ) const
+{
+ if (!m_render) return 0;
+
+ RenderObject::NodeInfo nodeInfo(true, true);
+ m_render->layer()->hitTest(nodeInfo, _x, _y);
+ NodeImpl* n = nodeInfo.innerNode();
+
+ while ( n && !n->isElementNode() ) {
+ n = n->parentNode();
+ }
+
+ return static_cast<ElementImpl*>(n);
+}
void DocumentImpl::addElementById(const DOMString &elementId, ElementImpl *element)
{
1.104.6.2 +1 -0 WebCore/khtml/xml/dom_docimpl.h
Index: dom_docimpl.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_docimpl.h,v
retrieving revision 1.104.6.1
retrieving revision 1.104.6.2
diff -u -r1.104.6.1 -r1.104.6.2
--- dom_docimpl.h 3 Jun 2005 21:11:45 -0000 1.104.6.1
+++ dom_docimpl.h 1 Jul 2005 22:36:04 -0000 1.104.6.2
@@ -197,6 +197,7 @@
NodeImpl *importNode( NodeImpl *importedNode, bool deep, int &exceptioncode );
virtual ElementImpl *createElementNS ( const DOMString &_namespaceURI, const DOMString &_qualifiedName, int &exceptioncode );
ElementImpl *getElementById ( const DOMString &elementId ) const;
+ ElementImpl *elementFromPoint ( const int _x, const int _y ) const;
// Actually part of HTMLDocument, but used for giving XML documents a window title as well
DOMString title() const { return m_title; }
More information about the webkit-changes
mailing list