Reviewed by xenon, bradee-oh
* css/html4.css:
* dom/Element.cpp:
(WebCore::Element::contains):
* dom/Element.h:
* html/HTMLLabelElement.cpp:
(WebCore::HTMLLabelElement::defaultEventHandler):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16359
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-09-13 David Hyatt <hyatt@apple.com>
+
+ Fix for 10841, unable to check checkboxes inside labels.
+
+ Reviewed by xenon, bradee-oh
+
+ * css/html4.css:
+ * dom/Element.cpp:
+ (WebCore::Element::contains):
+ * dom/Element.h:
+ * html/HTMLLabelElement.cpp:
+ (WebCore::HTMLLabelElement::defaultEventHandler):
+
2006-09-13 Mark Rowe <opendarwin.org@bdash.net.nz>
Reviewed by Adam.
label {
cursor: default;
- -webkit-user-select: none;
+ -webkit-user-select: ignore
}
legend {
return 0;
}
-bool Element::contains(const Element* element) const
+bool Element::contains(const Node* node) const
{
- if (!element)
+ if (!node)
return false;
- return this == element || element->isAncestor(this);
+ return this == node || node->isAncestor(this);
}
void Element::createAttributeMap() const
#endif
Node* insertAdjacentElement(const String& where, Node* newChild, int& exception);
- bool contains(const Element*) const;
+ bool contains(const Node*) const;
protected:
virtual void createAttributeMap() const;
if (evt->type() == clickEvent && !processingClick) {
HTMLElement* element = formElement();
- if (!element)
+
+ // If we can't find a control or if the control received the click
+ // event, then there's no need for us to do anything.
+ if (!element || element->contains(evt->target()))
return;
processingClick = true;