Changeset 112503 in webkit
- Timestamp:
- Mar 28, 2012 11:00:23 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r112502 r112503 1 2012-03-28 Kent Tamura <tkent@chromium.org> 2 3 Add TextFieldDecorationElement::decorate() 4 https://bugs.webkit.org/show_bug.cgi?id=82572 5 6 Reviewed by Hajime Morita. 7 8 This change will be needed for Bug 82143. 9 No new tests because of no behavior changes yet. This code change 10 doesn't affect non-Chromium ports for now. 11 12 * dom/ShadowRoot.cpp: 13 (WebCore::ShadowRoot::create): 14 Remove unnecessary assertion. We should allow multiple UA shadow roots. 15 * html/shadow/TextFieldDecorationElement.cpp: 16 (WebCore::TextFieldDecorationElement::decorate): 17 Added. 18 This function adds another ShadowRoot, and it contains one flexible box container. 19 The container contains existin ShadowRoot content and the decoration element. 20 * html/shadow/TextFieldDecorationElement.h: 21 (TextFieldDecorationElement): Add the declaration of decorate(). 22 1 23 2012-03-28 Vineet Chaudhary <rgf748@motorola.com> 2 24 -
trunk/Source/WebCore/dom/ShadowRoot.cpp
r111155 r112503 114 114 } 115 115 116 ASSERT(purpose != CreatingUserAgentShadowRoot || !element->hasShadowRoot());117 116 RefPtr<ShadowRoot> shadowRoot = adoptRef(new ShadowRoot(element->document())); 118 117 -
trunk/Source/WebCore/html/shadow/TextFieldDecorationElement.cpp
r112109 r112503 32 32 #include "TextFieldDecorationElement.h" 33 33 34 #include "CSSPropertyNames.h" 35 #include "CSSValueKeywords.h" 34 36 #include "Event.h" 35 37 #include "HTMLInputElement.h" 38 #include "HTMLShadowElement.h" 36 39 #include "NodeRenderStyle.h" 37 40 #include "RenderImage.h" 41 #include "ShadowRoot.h" 42 #include "ShadowTree.h" 38 43 39 44 namespace WebCore { … … 60 65 { 61 66 return adoptRef(new TextFieldDecorationElement(document, decorator)); 67 } 68 69 void TextFieldDecorationElement::decorate(HTMLInputElement* input) 70 { 71 ASSERT(input); 72 ShadowRoot* existingRoot = input->shadowTree()->youngestShadowRoot(); 73 RefPtr<ShadowRoot> newRoot = ShadowRoot::create(input, ShadowRoot::CreatingUserAgentShadowRoot, ASSERT_NO_EXCEPTION); 74 RefPtr<HTMLDivElement> box = HTMLDivElement::create(input->document()); 75 newRoot->appendChild(box); 76 box->setInlineStyleProperty(CSSPropertyDisplay, CSSValueWebkitBox); 77 box->setInlineStyleProperty(CSSPropertyWebkitBoxAlign, CSSValueCenter); 78 ASSERT(existingRoot); 79 ASSERT(existingRoot->childNodeCount() == 1); 80 toHTMLElement(existingRoot->firstChild())->setInlineStyleProperty(CSSPropertyWebkitBoxFlex, 1.0, CSSPrimitiveValue::CSS_NUMBER); 81 box->appendChild(HTMLShadowElement::create(HTMLNames::shadowTag, input->document())); 82 83 setInlineStyleProperty(CSSPropertyWebkitBoxFlex, 0.0, CSSPrimitiveValue::CSS_NUMBER); 84 box->appendChild(this); 62 85 } 63 86 -
trunk/Source/WebCore/html/shadow/TextFieldDecorationElement.h
r112109 r112503 64 64 static PassRefPtr<TextFieldDecorationElement> create(Document*, TextFieldDecorator*); 65 65 TextFieldDecorator* textFieldDecorator() { return m_textFieldDecorator; } 66 void decorate(HTMLInputElement*); 66 67 67 68 private:
Note: See TracChangeset
for help on using the changeset viewer.