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

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

Issue 1732753004: ImageInputType::ensurePrimaryContent should recreate UA shadow tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/forms/ImageInputType.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/html/HTMLInputElement.h" 5 #include "core/html/HTMLInputElement.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/html/HTMLBodyElement.h" 8 #include "core/html/HTMLBodyElement.h"
9 #include "core/html/HTMLFormElement.h" 9 #include "core/html/HTMLFormElement.h"
10 #include "core/html/HTMLHtmlElement.h" 10 #include "core/html/HTMLHtmlElement.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 document->body()->appendChild(form.get()); 63 document->body()->appendChild(form.get());
64 RefPtrWillBeRawPtr<HTMLInputElement> inputWithForm = HTMLInputElement::creat e(*document, nullptr, false); 64 RefPtrWillBeRawPtr<HTMLInputElement> inputWithForm = HTMLInputElement::creat e(*document, nullptr, false);
65 inputWithForm->setBooleanAttribute(HTMLNames::requiredAttr, true); 65 inputWithForm->setBooleanAttribute(HTMLNames::requiredAttr, true);
66 form->appendChild(inputWithForm.get()); 66 form->appendChild(inputWithForm.get());
67 EXPECT_EQ("<<ValidationValueMissing>>", inputWithForm->defaultToolTip()); 67 EXPECT_EQ("<<ValidationValueMissing>>", inputWithForm->defaultToolTip());
68 68
69 form->setBooleanAttribute(HTMLNames::novalidateAttr, true); 69 form->setBooleanAttribute(HTMLNames::novalidateAttr, true);
70 EXPECT_EQ(String(), inputWithForm->defaultToolTip()); 70 EXPECT_EQ(String(), inputWithForm->defaultToolTip());
71 } 71 }
72 72
73 // crbug.com/589838
74 TEST(HTMLInputElementTest, ImageTypeCrash)
75 {
76 RefPtrWillBeRawPtr<Document> document = Document::create();
77 RefPtrWillBeRawPtr<HTMLInputElement> input = HTMLInputElement::create(*docum ent, nullptr, false);
78 input->setAttribute(HTMLNames::typeAttr, "image");
79 input->ensureFallbackContent();
80 // Make sure ensurePrimaryContent() recreates UA shadow tree, and updating
81 // |value| doesn't crash.
82 input->ensurePrimaryContent();
83 input->setAttribute(HTMLNames::valueAttr, "aaa");
84 }
85
73 } // namespace blink 86 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/forms/ImageInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698