| Index: Source/core/html/shadow/TextFieldDecorationElement.cpp
|
| diff --git a/Source/core/html/shadow/TextFieldDecorationElement.cpp b/Source/core/html/shadow/TextFieldDecorationElement.cpp
|
| index c330767cbb4cb96d857f299142126badd9795980..b6755b7511b75451d80a08dc20f0c6f7353406ea 100644
|
| --- a/Source/core/html/shadow/TextFieldDecorationElement.cpp
|
| +++ b/Source/core/html/shadow/TextFieldDecorationElement.cpp
|
| @@ -80,7 +80,7 @@ TextFieldDecorationElement* TextFieldDecorationElement::fromShadowRoot(ShadowRoo
|
| return toTextFieldDecorationElement(shadowRoot->firstChild()->lastChild());
|
| }
|
|
|
| -static inline void getDecorationRootAndDecoratedRoot(HTMLInputElement* input, ShadowRoot*& decorationRoot, ShadowRoot*& decoratedRoot)
|
| +static inline void getDecorationRootAndDecoratedRoot(Handle<HTMLInputElement> input, ShadowRoot*& decorationRoot, ShadowRoot*& decoratedRoot)
|
| {
|
| ShadowRoot* existingRoot = input->youngestShadowRoot();
|
| ShadowRoot* newRoot = 0;
|
| @@ -96,13 +96,13 @@ static inline void getDecorationRootAndDecoratedRoot(HTMLInputElement* input, Sh
|
| // we can interleave user agent and author shadow roots on the element meaning
|
| // input.shadowRoot may be inaccessible if the browser has decided to decorate
|
| // the input.
|
| - newRoot = input->ensureShadow()->addShadowRoot(input, ShadowRoot::UserAgentShadowRoot);
|
| + newRoot = input->ensureShadow()->addShadowRoot(input.raw(), ShadowRoot::UserAgentShadowRoot);
|
| }
|
| decorationRoot = newRoot;
|
| decoratedRoot = existingRoot;
|
| }
|
|
|
| -void TextFieldDecorationElement::decorate(HTMLInputElement* input, bool visible)
|
| +void TextFieldDecorationElement::decorate(Handle<HTMLInputElement> input, bool visible)
|
| {
|
| ASSERT(input);
|
| ShadowRoot* existingRoot;
|
| @@ -121,12 +121,12 @@ void TextFieldDecorationElement::decorate(HTMLInputElement* input, bool visible)
|
| box->appendChild(this);
|
| }
|
|
|
| -inline HTMLInputElement* TextFieldDecorationElement::hostInput()
|
| +inline Result<HTMLInputElement> TextFieldDecorationElement::hostInput()
|
| {
|
| // TextFieldDecorationElement is created only by C++ code, and it is always
|
| // in <input> shadow.
|
| ASSERT_WITH_SECURITY_IMPLICATION(!shadowHost() || shadowHost()->hasTagName(inputTag));
|
| - return static_cast<HTMLInputElement*>(shadowHost());
|
| + return Handle<HTMLInputElement>(static_cast<HTMLInputElement*>(shadowHost()));
|
| }
|
|
|
| bool TextFieldDecorationElement::isTextFieldDecoration() const
|
| @@ -190,7 +190,7 @@ bool TextFieldDecorationElement::isMouseFocusable() const
|
|
|
| void TextFieldDecorationElement::defaultEventHandler(Event* event)
|
| {
|
| - RefPtr<HTMLInputElement> input(hostInput());
|
| + Handle<HTMLInputElement> input(hostInput());
|
| if (!input || input->isDisabledOrReadOnly() || !event->isMouseEvent()) {
|
| if (!event->defaultHandled())
|
| HTMLDivElement::defaultEventHandler(event);
|
| @@ -199,7 +199,7 @@ void TextFieldDecorationElement::defaultEventHandler(Event* event)
|
|
|
| RefPtr<TextFieldDecorationElement> protector(this);
|
| if (event->type() == eventNames().clickEvent) {
|
| - m_textFieldDecorator->handleClick(input.get());
|
| + m_textFieldDecorator->handleClick(input);
|
| event->setDefaultHandled();
|
| }
|
|
|
| @@ -219,7 +219,7 @@ void TextFieldDecorationElement::defaultEventHandler(Event* event)
|
|
|
| bool TextFieldDecorationElement::willRespondToMouseMoveEvents()
|
| {
|
| - const HTMLInputElement* input = hostInput();
|
| + Handle<const HTMLInputElement> input = hostInput();
|
| if (!input->isDisabledOrReadOnly())
|
| return true;
|
|
|
| @@ -228,7 +228,7 @@ bool TextFieldDecorationElement::willRespondToMouseMoveEvents()
|
|
|
| bool TextFieldDecorationElement::willRespondToMouseClickEvents()
|
| {
|
| - const HTMLInputElement* input = hostInput();
|
| + Handle<const HTMLInputElement> input = hostInput();
|
| if (!input->isDisabledOrReadOnly())
|
| return true;
|
|
|
|
|