Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: Source/core/html/HTMLLabelElement.h

Issue 106423005: Only 'form associated' elements have a potential form owner. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 16 matching lines...) Expand all
27 #include "core/html/HTMLElement.h" 27 #include "core/html/HTMLElement.h"
28 #include "core/html/LabelableElement.h" 28 #include "core/html/LabelableElement.h"
29 29
30 namespace WebCore { 30 namespace WebCore {
31 31
32 class HTMLLabelElement FINAL : public HTMLElement { 32 class HTMLLabelElement FINAL : public HTMLElement {
33 public: 33 public:
34 static PassRefPtr<HTMLLabelElement> create(Document&); 34 static PassRefPtr<HTMLLabelElement> create(Document&);
35 35
36 LabelableElement* control(); 36 LabelableElement* control();
37 HTMLFormElement* form() const;
sof 2013/12/10 17:26:05 The removal of this method would have belonged bet
38 37
39 virtual bool willRespondToMouseClickEvents() OVERRIDE; 38 virtual bool willRespondToMouseClickEvents() OVERRIDE;
40 39
41 private: 40 private:
42 explicit HTMLLabelElement(Document&); 41 explicit HTMLLabelElement(Document&);
43 bool isInInteractiveContent(Node*) const; 42 bool isInInteractiveContent(Node*) const;
44 43
45 virtual bool rendererIsFocusable() const OVERRIDE; 44 virtual bool rendererIsFocusable() const OVERRIDE;
46 virtual bool isInteractiveContent() const OVERRIDE; 45 virtual bool isInteractiveContent() const OVERRIDE;
46 virtual bool isFormAssociatedElement() const OVERRIDE { return true; }
47 virtual void accessKeyAction(bool sendMouseEvents); 47 virtual void accessKeyAction(bool sendMouseEvents);
48 48
49 // Overridden to update the hover/active state of the corresponding control. 49 // Overridden to update the hover/active state of the corresponding control.
50 virtual void setActive(bool = true) OVERRIDE; 50 virtual void setActive(bool = true) OVERRIDE;
51 virtual void setHovered(bool = true) OVERRIDE; 51 virtual void setHovered(bool = true) OVERRIDE;
52 52
53 // Overridden to either click() or focus() the corresponding control. 53 // Overridden to either click() or focus() the corresponding control.
54 virtual void defaultEventHandler(Event*); 54 virtual void defaultEventHandler(Event*);
55 55
56 virtual void focus(bool restorePreviousSelection, FocusDirection) OVERRIDE; 56 virtual void focus(bool restorePreviousSelection, FocusDirection) OVERRIDE;
57
58 virtual HTMLFormElement* virtualForm() const;
57 }; 59 };
58 60
59 inline bool isHTMLLabelElement(const Node* node) 61 inline bool isHTMLLabelElement(const Node* node)
60 { 62 {
61 return node->hasTagName(HTMLNames::labelTag); 63 return node->hasTagName(HTMLNames::labelTag);
62 } 64 }
63 65
64 inline bool isHTMLLabelElement(const Element* element) 66 inline bool isHTMLLabelElement(const Element* element)
65 { 67 {
66 return element->hasTagName(HTMLNames::labelTag); 68 return element->hasTagName(HTMLNames::labelTag);
67 } 69 }
68 70
69 DEFINE_NODE_TYPE_CASTS(HTMLLabelElement, hasTagName(HTMLNames::labelTag)); 71 DEFINE_NODE_TYPE_CASTS(HTMLLabelElement, hasTagName(HTMLNames::labelTag));
70 72
71 } //namespace 73 } //namespace
72 74
73 #endif 75 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698