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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLInputElement.cpp

Issue 1901403002: Remove UserAgent ShadowRoot + Author ShadowRoot code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Element::createShadowRoot, update some tests Created 4 years, 8 months 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) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
10 * Copyright (C) 2012 Samsung Electronics. All rights reserved. 10 * Copyright (C) 2012 Samsung Electronics. All rights reserved.
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 if (!m_imageLoader) 152 if (!m_imageLoader)
153 m_imageLoader = HTMLImageLoader::create(this); 153 m_imageLoader = HTMLImageLoader::create(this);
154 return *m_imageLoader; 154 return *m_imageLoader;
155 } 155 }
156 156
157 void HTMLInputElement::didAddUserAgentShadowRoot(ShadowRoot&) 157 void HTMLInputElement::didAddUserAgentShadowRoot(ShadowRoot&)
158 { 158 {
159 m_inputTypeView->createShadowSubtree(); 159 m_inputTypeView->createShadowSubtree();
160 } 160 }
161 161
162 void HTMLInputElement::willAddFirstAuthorShadowRoot()
163 {
164 m_inputTypeView->destroyShadowSubtree();
165 m_inputTypeView = InputTypeView::create(*this);
166 lazyReattachIfAttached();
167 }
168
169 HTMLInputElement::~HTMLInputElement() 162 HTMLInputElement::~HTMLInputElement()
170 { 163 {
171 } 164 }
172 165
173 const AtomicString& HTMLInputElement::name() const 166 const AtomicString& HTMLInputElement::name() const
174 { 167 {
175 return m_name.isNull() ? emptyAtom : m_name; 168 return m_name.isNull() ? emptyAtom : m_name;
176 } 169 }
177 170
178 Vector<FileChooserFileInfo> HTMLInputElement::filesFromFileInputFormControlState (const FormControlState& state) 171 Vector<FileChooserFileInfo> HTMLInputElement::filesFromFileInputFormControlState (const FormControlState& state)
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 removeFromRadioButtonGroup(); 458 removeFromRadioButtonGroup();
466 459
467 bool didStoreValue = m_inputType->storesValueSeparateFromAttribute(); 460 bool didStoreValue = m_inputType->storesValueSeparateFromAttribute();
468 bool didRespectHeightAndWidth = m_inputType->shouldRespectHeightAndWidthAttr ibutes(); 461 bool didRespectHeightAndWidth = m_inputType->shouldRespectHeightAndWidthAttr ibutes();
469 bool couldBeSuccessfulSubmitButton = canBeSuccessfulSubmitButton(); 462 bool couldBeSuccessfulSubmitButton = canBeSuccessfulSubmitButton();
470 463
471 m_inputTypeView->destroyShadowSubtree(); 464 m_inputTypeView->destroyShadowSubtree();
472 lazyReattachIfAttached(); 465 lazyReattachIfAttached();
473 466
474 m_inputType = newType; 467 m_inputType = newType;
475 if (openShadowRoot()) 468 m_inputTypeView = m_inputType->createView();
476 m_inputTypeView = InputTypeView::create(*this);
477 else
478 m_inputTypeView = m_inputType->createView();
479 m_inputTypeView->createShadowSubtree(); 469 m_inputTypeView->createShadowSubtree();
480 470
481 updateTouchEventHandlerRegistry(); 471 updateTouchEventHandlerRegistry();
482 472
483 setNeedsWillValidateCheck(); 473 setNeedsWillValidateCheck();
484 474
485 bool willStoreValue = m_inputType->storesValueSeparateFromAttribute(); 475 bool willStoreValue = m_inputType->storesValueSeparateFromAttribute();
486 476
487 if (didStoreValue && !willStoreValue && hasDirtyValue()) { 477 if (didStoreValue && !willStoreValue && hasDirtyValue()) {
488 setAttribute(valueAttr, AtomicString(m_valueIfDirty)); 478 setAttribute(valueAttr, AtomicString(m_valueIfDirty));
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after
1927 void HTMLInputElement::ensurePrimaryContent() 1917 void HTMLInputElement::ensurePrimaryContent()
1928 { 1918 {
1929 m_inputTypeView->ensurePrimaryContent(); 1919 m_inputTypeView->ensurePrimaryContent();
1930 } 1920 }
1931 1921
1932 bool HTMLInputElement::hasFallbackContent() const 1922 bool HTMLInputElement::hasFallbackContent() const
1933 { 1923 {
1934 return m_inputTypeView->hasFallbackContent(); 1924 return m_inputTypeView->hasFallbackContent();
1935 } 1925 }
1936 } // namespace blink 1926 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLInputElement.h ('k') | third_party/WebKit/Source/core/html/HTMLPlugInElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698