Commit 3e042026 authored by tkent@chromium.org's avatar tkent@chromium.org

Unindent namespace content of WebElement.h, WebFormElement.h, and WebInputElement.h

These are the last instances of namespace indentation in public/.

BUG=none
TEST=none; no behavior changes.

Review URL: https://codereview.chromium.org/476633002

git-svn-id: svn://svn.chromium.org/blink/trunk@180271 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent a08916b1
...@@ -39,55 +39,55 @@ namespace blink { ...@@ -39,55 +39,55 @@ namespace blink {
class Element; class Element;
struct WebRect; struct WebRect;
// Provides access to some properties of a DOM element node. // Provides access to some properties of a DOM element node.
class WebElement : public WebNode { class WebElement : public WebNode {
public: public:
WebElement() : WebNode() { } WebElement() : WebNode() { }
WebElement(const WebElement& e) : WebNode(e) { } WebElement(const WebElement& e) : WebNode(e) { }
WebElement& operator=(const WebElement& e) { WebNode::assign(e); return *this; } WebElement& operator=(const WebElement& e) { WebNode::assign(e); return *this; }
void assign(const WebElement& e) { WebNode::assign(e); } void assign(const WebElement& e) { WebNode::assign(e); }
BLINK_EXPORT bool isFormControlElement() const; BLINK_EXPORT bool isFormControlElement() const;
BLINK_EXPORT bool isTextFormControlElement() const; BLINK_EXPORT bool isTextFormControlElement() const;
// Returns the qualified name, which may contain a prefix and a colon. // Returns the qualified name, which may contain a prefix and a colon.
BLINK_EXPORT WebString tagName() const; BLINK_EXPORT WebString tagName() const;
// Check if this element has the specified local tag name, and the HTML // Check if this element has the specified local tag name, and the HTML
// namespace. Tag name matching is case-insensitive. // namespace. Tag name matching is case-insensitive.
BLINK_EXPORT bool hasHTMLTagName(const WebString&) const; BLINK_EXPORT bool hasHTMLTagName(const WebString&) const;
BLINK_EXPORT bool hasAttribute(const WebString&) const; BLINK_EXPORT bool hasAttribute(const WebString&) const;
BLINK_EXPORT void removeAttribute(const WebString&); BLINK_EXPORT void removeAttribute(const WebString&);
BLINK_EXPORT WebString getAttribute(const WebString&) const; BLINK_EXPORT WebString getAttribute(const WebString&) const;
BLINK_EXPORT bool setAttribute(const WebString& name, const WebString& value); BLINK_EXPORT bool setAttribute(const WebString& name, const WebString& value);
BLINK_EXPORT WebString innerText(); BLINK_EXPORT WebString innerText();
BLINK_EXPORT void requestFullScreen(); BLINK_EXPORT void requestFullScreen();
BLINK_EXPORT WebString attributeLocalName(unsigned index) const; BLINK_EXPORT WebString attributeLocalName(unsigned index) const;
BLINK_EXPORT WebString attributeValue(unsigned index) const; BLINK_EXPORT WebString attributeValue(unsigned index) const;
BLINK_EXPORT unsigned attributeCount() const; BLINK_EXPORT unsigned attributeCount() const;
BLINK_EXPORT WebNode shadowRoot() const; BLINK_EXPORT WebNode shadowRoot() const;
// Returns the language code specified for this element. This attribute // Returns the language code specified for this element. This attribute
// is inherited, so the returned value is drawn from the closest parent // is inherited, so the returned value is drawn from the closest parent
// element that has the lang attribute set, or from the HTTP // element that has the lang attribute set, or from the HTTP
// "Content-Language" header as a fallback. // "Content-Language" header as a fallback.
BLINK_EXPORT WebString computeInheritedLanguage() const; BLINK_EXPORT WebString computeInheritedLanguage() const;
// Returns the bounds of the element in viewport space. The bounds // Returns the bounds of the element in viewport space. The bounds
// have been adjusted to include any transformations. This view is // have been adjusted to include any transformations. This view is
// also called the Root View in WebKit. // also called the Root View in Blink.
// This function will update the layout if required. // This function will update the layout if required.
BLINK_EXPORT WebRect boundsInViewportSpace(); BLINK_EXPORT WebRect boundsInViewportSpace();
// Returns the image contents of this element or a null WebImage // Returns the image contents of this element or a null WebImage
// if there isn't any. // if there isn't any.
BLINK_EXPORT WebImage imageContents(); BLINK_EXPORT WebImage imageContents();
#if BLINK_IMPLEMENTATION #if BLINK_IMPLEMENTATION
WebElement(const PassRefPtrWillBeRawPtr<Element>&); WebElement(const PassRefPtrWillBeRawPtr<Element>&);
WebElement& operator=(const PassRefPtrWillBeRawPtr<Element>&); WebElement& operator=(const PassRefPtrWillBeRawPtr<Element>&);
operator PassRefPtrWillBeRawPtr<Element>() const; operator PassRefPtrWillBeRawPtr<Element>() const;
#endif #endif
}; };
} // namespace blink } // namespace blink
......
...@@ -40,49 +40,50 @@ class HTMLFormElement; ...@@ -40,49 +40,50 @@ class HTMLFormElement;
class WebInputElement; class WebInputElement;
class WebFormControlElement; class WebFormControlElement;
// A container for passing around a reference to a form element. Provides // A container for passing around a reference to a form element. Provides some
// some information about the form. // information about the form.
class WebFormElement : public WebElement { class WebFormElement : public WebElement {
public: public:
~WebFormElement() { reset(); } ~WebFormElement() { reset(); }
WebFormElement() : WebElement() { } WebFormElement() : WebElement() { }
WebFormElement(const WebFormElement& element) : WebElement(element) { } WebFormElement(const WebFormElement& element) : WebElement(element) { }
WebFormElement& operator=(const WebFormElement& element) WebFormElement& operator=(const WebFormElement& element)
{ {
WebElement::assign(element); WebElement::assign(element);
return *this; return *this;
} }
void assign(const WebFormElement& element) { WebElement::assign(element); } void assign(const WebFormElement& element) { WebElement::assign(element); }
BLINK_EXPORT bool autoComplete() const; BLINK_EXPORT bool autoComplete() const;
BLINK_EXPORT WebString action() const; BLINK_EXPORT WebString action() const;
BLINK_EXPORT WebString name() const; BLINK_EXPORT WebString name() const;
BLINK_EXPORT WebString method() const; BLINK_EXPORT WebString method() const;
BLINK_EXPORT bool wasUserSubmitted() const; BLINK_EXPORT bool wasUserSubmitted() const;
BLINK_EXPORT void submit(); BLINK_EXPORT void submit();
// FIXME: Deprecate and replace with WebVector<WebElement>. // FIXME: Deprecate and replace with WebVector<WebElement>.
BLINK_EXPORT void getNamedElements(const WebString&, WebVector<WebNode>&); BLINK_EXPORT void getNamedElements(const WebString&, WebVector<WebNode>&);
BLINK_EXPORT void getFormControlElements(WebVector<WebFormControlElement>&) const; BLINK_EXPORT void getFormControlElements(WebVector<WebFormControlElement>&) const;
// NOTE: This function dispatches "invalid" events. Only call this if required by a specification (e.g. requestAutocomplete()). // NOTE: This function dispatches "invalid" events. Only call this if
BLINK_EXPORT bool checkValidity(); // required by a specification (e.g. requestAutocomplete()).
BLINK_EXPORT bool checkValidity();
enum AutocompleteResult { enum AutocompleteResult {
AutocompleteResultSuccess, AutocompleteResultSuccess,
AutocompleteResultErrorDisabled, AutocompleteResultErrorDisabled,
AutocompleteResultErrorCancel, AutocompleteResultErrorCancel,
AutocompleteResultErrorInvalid, AutocompleteResultErrorInvalid,
}; };
BLINK_EXPORT void finishRequestAutocomplete(WebFormElement::AutocompleteResult); BLINK_EXPORT void finishRequestAutocomplete(WebFormElement::AutocompleteResult);
#if BLINK_IMPLEMENTATION #if BLINK_IMPLEMENTATION
WebFormElement(const PassRefPtrWillBeRawPtr<HTMLFormElement>&); WebFormElement(const PassRefPtrWillBeRawPtr<HTMLFormElement>&);
WebFormElement& operator=(const PassRefPtrWillBeRawPtr<HTMLFormElement>&); WebFormElement& operator=(const PassRefPtrWillBeRawPtr<HTMLFormElement>&);
operator PassRefPtrWillBeRawPtr<HTMLFormElement>() const; operator PassRefPtrWillBeRawPtr<HTMLFormElement>() const;
#endif #endif
}; };
} // namespace blink } // namespace blink
......
...@@ -38,65 +38,66 @@ namespace blink { ...@@ -38,65 +38,66 @@ namespace blink {
class HTMLInputElement; class HTMLInputElement;
class WebElementCollection; class WebElementCollection;
// Provides readonly access to some properties of a DOM input element node. // Provides readonly access to some properties of a DOM input element node.
class WebInputElement : public WebFormControlElement { class WebInputElement : public WebFormControlElement {
public: public:
WebInputElement() : WebFormControlElement() { } WebInputElement() : WebFormControlElement() { }
WebInputElement(const WebInputElement& element) : WebFormControlElement(element) { } WebInputElement(const WebInputElement& element) : WebFormControlElement(element) { }
WebInputElement& operator=(const WebInputElement& element) WebInputElement& operator=(const WebInputElement& element)
{ {
WebFormControlElement::assign(element); WebFormControlElement::assign(element);
return *this; return *this;
} }
void assign(const WebInputElement& element) { WebFormControlElement::assign(element); } void assign(const WebInputElement& element) { WebFormControlElement::assign(element); }
// This returns true for all of textfield-looking types such as text, // This returns true for all of textfield-looking types such as text,
// password, search, email, url, and number. // password, search, email, url, and number.
BLINK_EXPORT bool isTextField() const; BLINK_EXPORT bool isTextField() const;
// This returns true only for type=text. // This returns true only for type=text.
BLINK_EXPORT bool isText() const; BLINK_EXPORT bool isText() const;
BLINK_EXPORT bool isEmailField() const; BLINK_EXPORT bool isEmailField() const;
BLINK_EXPORT bool isPasswordField() const; BLINK_EXPORT bool isPasswordField() const;
BLINK_EXPORT bool isImageButton() const; BLINK_EXPORT bool isImageButton() const;
BLINK_EXPORT bool isRadioButton() const; BLINK_EXPORT bool isRadioButton() const;
BLINK_EXPORT bool isCheckbox() const; BLINK_EXPORT bool isCheckbox() const;
BLINK_EXPORT int maxLength() const; BLINK_EXPORT int maxLength() const;
BLINK_EXPORT void setActivatedSubmit(bool); BLINK_EXPORT void setActivatedSubmit(bool);
BLINK_EXPORT int size() const; BLINK_EXPORT int size() const;
BLINK_EXPORT void setChecked(bool, bool sendEvents = false); BLINK_EXPORT void setChecked(bool, bool sendEvents = false);
// Sets the value inside the text field without being sanitized. // Sets the value inside the text field without being sanitized. Can't be
// Can't be used if a renderer doesn't exist or on a non text field type. // used if a renderer doesn't exist or on a non text field type. Caret will
// Caret will be moved to the end. // be moved to the end.
BLINK_EXPORT void setEditingValue(const WebString&); BLINK_EXPORT void setEditingValue(const WebString&);
BLINK_EXPORT bool isValidValue(const WebString&) const; BLINK_EXPORT bool isValidValue(const WebString&) const;
BLINK_EXPORT bool isChecked() const; BLINK_EXPORT bool isChecked() const;
BLINK_EXPORT bool isMultiple() const; BLINK_EXPORT bool isMultiple() const;
BLINK_EXPORT WebElementCollection dataListOptions() const; BLINK_EXPORT WebElementCollection dataListOptions() const;
// Return the localized value for this input type. // Return the localized value for this input type.
BLINK_EXPORT WebString localizeValue(const WebString&) const; BLINK_EXPORT WebString localizeValue(const WebString&) const;
// Exposes the default value of the maxLength attribute. // Exposes the default value of the maxLength attribute.
BLINK_EXPORT static int defaultMaxLength(); BLINK_EXPORT static int defaultMaxLength();
// If true, forces the text of the element to be visible. // If true, forces the text of the element to be visible.
BLINK_EXPORT void setShouldRevealPassword(bool value); BLINK_EXPORT void setShouldRevealPassword(bool value);
#if BLINK_IMPLEMENTATION #if BLINK_IMPLEMENTATION
WebInputElement(const PassRefPtrWillBeRawPtr<HTMLInputElement>&); WebInputElement(const PassRefPtrWillBeRawPtr<HTMLInputElement>&);
WebInputElement& operator=(const PassRefPtrWillBeRawPtr<HTMLInputElement>&); WebInputElement& operator=(const PassRefPtrWillBeRawPtr<HTMLInputElement>&);
operator PassRefPtrWillBeRawPtr<HTMLInputElement>() const; operator PassRefPtrWillBeRawPtr<HTMLInputElement>() const;
#endif #endif
}; };
BLINK_EXPORT WebInputElement* toWebInputElement(WebElement*); // This returns 0 if the specified WebElement is not a WebInputElement.
BLINK_EXPORT WebInputElement* toWebInputElement(WebElement*);
inline const WebInputElement* toWebInputElement(const WebElement* element) // This returns 0 if the specified WebElement is not a WebInputElement.
{ inline const WebInputElement* toWebInputElement(const WebElement* element)
return toWebInputElement(const_cast<WebElement*>(element)); {
} return toWebInputElement(const_cast<WebElement*>(element));
}
} // namespace blink } // namespace blink
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment