Changeset 13555 in webkit
- Timestamp:
- Mar 29, 2006 1:38:54 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r13553 r13555 1 2006-03-29 Maciej Stachowiak <mjs@apple.com> 2 3 Reviewed by Anders. 4 5 Test cases for Element.contains, including testing fix for 6 <rdar://problem/4405353> JavaScript flickers popups onmouseover 7 8 * fast/dom/Element/contains-method-expected.txt: Added. 9 * fast/dom/Element/contains-method.html: Added. 10 * fast/dom/Element/resources/contains-method.js: Added. 11 * fast/events/capture-on-target.html: 12 1 13 2006-03-28 Beth Dakin <bdakin@apple.com> 2 14 -
trunk/WebCore/ChangeLog
r13554 r13555 1 2006-03-29 Maciej Stachowiak <mjs@apple.com> 2 3 Reviewed by Anders. 4 5 - fixed <rdar://problem/4454976> repro crash in -[NSTextView(NSSharing) setSelectedRanges:affinity:stillSelecting:] when navigating 6 7 Also fixed other issues with contains. The problem that caused the bug was: 8 - contains should return true for the element itself, unlike isAncestor 9 10 Other problems I fixed: 11 - contains shouldn't be present on non-Element nodes 12 - contains should return false when passed a non-Element node 13 - contains should return false when passed a non-Node 14 15 * bindings/scripts/CodeGeneratorJS.pm: Handle Element as a parameter. 16 * dom/Element.cpp: 17 (WebCore::Element::contains): Added new implementation. 18 * dom/Element.h: Added prototype for contains. 19 * dom/Element.idl: Added IDL declaration for contains. 20 * khtml/ecma/kjs_dom.cpp: 21 (KJS::DOMNodeProtoFunc::callAsFunction): Added old wrong contains(). 22 1 23 2006-03-28 Beth Dakin <bdakin@apple.com> 2 24 -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r13548 r13555 711 711 return "AbstractView*"; 712 712 } elsif ($type eq "Node" or 713 $type eq "Element" or 713 714 $type eq "Attr" or 714 715 $type eq "DocumentType" or … … 748 749 } elsif ($type eq "Node") { 749 750 return 0; 751 } elsif ($type eq "Element") { 752 return 0; 750 753 } elsif ($type eq "Attr") { 751 754 $implIncludes{"ExceptionCode.h"} = 1; … … 807 810 $implIncludes{"JSRange.h"} = 1; 808 811 return "toRange($value)"; 812 } elsif ($type eq "Element") { 813 $implIncludes{"kjs_dom.h"} = 1; 814 return "toElement($value)"; 809 815 } else { 810 816 die "Don't know how to convert a JS value of type $type." -
trunk/WebCore/dom/Element.cpp
r13547 r13555 289 289 } 290 290 291 bool Element::contains(const Element* element) const 292 { 293 if (!element) 294 return false; 295 return this == element || element->isAncestor(this); 296 } 297 291 298 void Element::createAttributeMap() const 292 299 { -
trunk/WebCore/dom/Element.h
r13492 r13555 144 144 145 145 Node* insertAdjacentElement(const String& where, Node* newChild, int& exception); 146 bool contains(const Element*) const; 146 147 147 148 protected: -
trunk/WebCore/dom/Element.idl
r13492 r13555 80 80 void blur(); 81 81 82 // IE only extension83 Node insertAdjacentElement(in DOMString position,84 in Node newAttr)85 raises(DOMException);86 87 82 readonly attribute CSSStyleDeclaration style; 88 83 84 // IE only extensions 85 Node insertAdjacentElement(in DOMString position, 86 in Node newElement) 87 raises(DOMException); 88 89 boolean contains(in Element element); 89 90 }; 90 91 -
trunk/WebCore/khtml/ecma/kjs_dom.cpp
r13548 r13555 88 88 lookupNamespaceURI DOMNode::LookupNamespaceURI DontDelete|Function 1 89 89 lookupPrefix DOMNode::LookupPrefix DontDelete|Function 1 90 # IE extension91 contains DOMNode::Contains DontDelete|Function 192 90 # "DOM level 0" (from Gecko DOM reference; also in WinIE) 93 91 item DOMNode::Item DontDelete|Function 1 … … 321 319 return args[1]; 322 320 return jsNull(); 323 case DOMNode::Contains:324 if (node.isElementNode())325 if (Node *node0 = toNode(args[0]))326 return jsBoolean(node.isAncestor(node0));327 // FIXME: Is there a good reason to return undefined rather than false328 // when the parameter is not a node? When the object is not an element?329 return jsUndefined();330 321 case DOMNode::Item: 331 322 return thisObj->get(exec, args[0]->toInt32(exec));
Note: See TracChangeset
for help on using the changeset viewer.