| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 #include "core/HTMLNames.h" | 30 #include "core/HTMLNames.h" |
| 31 #include "core/dom/Document.h" | 31 #include "core/dom/Document.h" |
| 32 #include "core/dom/NodeLayoutStyle.h" | 32 #include "core/dom/NodeLayoutStyle.h" |
| 33 #include "core/events/MouseEvent.h" | 33 #include "core/events/MouseEvent.h" |
| 34 #include "core/events/TextEvent.h" | 34 #include "core/events/TextEvent.h" |
| 35 #include "core/events/TextEventInputType.h" | 35 #include "core/events/TextEventInputType.h" |
| 36 #include "core/frame/LocalFrame.h" | 36 #include "core/frame/LocalFrame.h" |
| 37 #include "core/html/HTMLInputElement.h" | 37 #include "core/html/HTMLInputElement.h" |
| 38 #include "core/html/shadow/ShadowElementNames.h" | 38 #include "core/html/shadow/ShadowElementNames.h" |
| 39 #include "core/layout/LayoutTextControlSingleLine.h" |
| 39 #include "core/page/EventHandler.h" | 40 #include "core/page/EventHandler.h" |
| 40 #include "core/rendering/RenderTextControlSingleLine.h" | |
| 41 #include "core/rendering/RenderView.h" | 41 #include "core/rendering/RenderView.h" |
| 42 #include "platform/UserGestureIndicator.h" | 42 #include "platform/UserGestureIndicator.h" |
| 43 | 43 |
| 44 namespace blink { | 44 namespace blink { |
| 45 | 45 |
| 46 using namespace HTMLNames; | 46 using namespace HTMLNames; |
| 47 | 47 |
| 48 TextControlInnerContainer::TextControlInnerContainer(Document& document) | 48 TextControlInnerContainer::TextControlInnerContainer(Document& document) |
| 49 : HTMLDivElement(document) | 49 : HTMLDivElement(document) |
| 50 { | 50 { |
| 51 } | 51 } |
| 52 | 52 |
| 53 PassRefPtrWillBeRawPtr<TextControlInnerContainer> TextControlInnerContainer::cre
ate(Document& document) | 53 PassRefPtrWillBeRawPtr<TextControlInnerContainer> TextControlInnerContainer::cre
ate(Document& document) |
| 54 { | 54 { |
| 55 RefPtrWillBeRawPtr<TextControlInnerContainer> element = adoptRefWillBeNoop(n
ew TextControlInnerContainer(document)); | 55 RefPtrWillBeRawPtr<TextControlInnerContainer> element = adoptRefWillBeNoop(n
ew TextControlInnerContainer(document)); |
| 56 element->setAttribute(idAttr, ShadowElementNames::textFieldContainer()); | 56 element->setAttribute(idAttr, ShadowElementNames::textFieldContainer()); |
| 57 return element.release(); | 57 return element.release(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 LayoutObject* TextControlInnerContainer::createRenderer(const LayoutStyle&) | 60 LayoutObject* TextControlInnerContainer::createRenderer(const LayoutStyle&) |
| 61 { | 61 { |
| 62 return new RenderTextControlInnerContainer(this); | 62 return new LayoutTextControlInnerContainer(this); |
| 63 } | 63 } |
| 64 | 64 |
| 65 // --------------------------- | 65 // --------------------------- |
| 66 | 66 |
| 67 EditingViewPortElement::EditingViewPortElement(Document& document) | 67 EditingViewPortElement::EditingViewPortElement(Document& document) |
| 68 : HTMLDivElement(document) | 68 : HTMLDivElement(document) |
| 69 { | 69 { |
| 70 setHasCustomStyleCallbacks(); | 70 setHasCustomStyleCallbacks(); |
| 71 } | 71 } |
| 72 | 72 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // the event up the chain. | 125 // the event up the chain. |
| 126 if (shadowAncestor) | 126 if (shadowAncestor) |
| 127 shadowAncestor->defaultEventHandler(event); | 127 shadowAncestor->defaultEventHandler(event); |
| 128 } | 128 } |
| 129 if (!event->defaultHandled()) | 129 if (!event->defaultHandled()) |
| 130 HTMLDivElement::defaultEventHandler(event); | 130 HTMLDivElement::defaultEventHandler(event); |
| 131 } | 131 } |
| 132 | 132 |
| 133 LayoutObject* TextControlInnerEditorElement::createRenderer(const LayoutStyle&) | 133 LayoutObject* TextControlInnerEditorElement::createRenderer(const LayoutStyle&) |
| 134 { | 134 { |
| 135 return new RenderTextControlInnerBlock(this); | 135 return new LayoutTextControlInnerBlock(this); |
| 136 } | 136 } |
| 137 | 137 |
| 138 PassRefPtr<LayoutStyle> TextControlInnerEditorElement::customStyleForRenderer() | 138 PassRefPtr<LayoutStyle> TextControlInnerEditorElement::customStyleForRenderer() |
| 139 { | 139 { |
| 140 LayoutObject* parentRenderer = shadowHost()->renderer(); | 140 LayoutObject* parentRenderer = shadowHost()->renderer(); |
| 141 if (!parentRenderer || !parentRenderer->isTextControl()) | 141 if (!parentRenderer || !parentRenderer->isTextControl()) |
| 142 return originalStyleForRenderer(); | 142 return originalStyleForRenderer(); |
| 143 RenderTextControl* textControlRenderer = toRenderTextControl(parentRenderer)
; | 143 LayoutTextControl* textControlRenderer = toLayoutTextControl(parentRenderer)
; |
| 144 return textControlRenderer->createInnerEditorStyle(textControlRenderer->styl
eRef()); | 144 return textControlRenderer->createInnerEditorStyle(textControlRenderer->styl
eRef()); |
| 145 } | 145 } |
| 146 | 146 |
| 147 // ---------------------------- | 147 // ---------------------------- |
| 148 | 148 |
| 149 inline SearchFieldDecorationElement::SearchFieldDecorationElement(Document& docu
ment) | 149 inline SearchFieldDecorationElement::SearchFieldDecorationElement(Document& docu
ment) |
| 150 : HTMLDivElement(document) | 150 : HTMLDivElement(document) |
| 151 { | 151 { |
| 152 } | 152 } |
| 153 | 153 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 bool SearchFieldCancelButtonElement::willRespondToMouseClickEvents() | 243 bool SearchFieldCancelButtonElement::willRespondToMouseClickEvents() |
| 244 { | 244 { |
| 245 const HTMLInputElement* input = toHTMLInputElement(shadowHost()); | 245 const HTMLInputElement* input = toHTMLInputElement(shadowHost()); |
| 246 if (input && !input->isDisabledOrReadOnly()) | 246 if (input && !input->isDisabledOrReadOnly()) |
| 247 return true; | 247 return true; |
| 248 | 248 |
| 249 return HTMLDivElement::willRespondToMouseClickEvents(); | 249 return HTMLDivElement::willRespondToMouseClickEvents(); |
| 250 } | 250 } |
| 251 | 251 |
| 252 } | 252 } |
| OLD | NEW |