OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 return; | 63 return; |
64 } | 64 } |
65 | 65 |
66 if (!m_clearButtonOwner->shouldClearButtonRespondToMouseEvents()) { | 66 if (!m_clearButtonOwner->shouldClearButtonRespondToMouseEvents()) { |
67 if (!event->defaultHandled()) | 67 if (!event->defaultHandled()) |
68 HTMLDivElement::defaultEventHandler(event); | 68 HTMLDivElement::defaultEventHandler(event); |
69 return; | 69 return; |
70 } | 70 } |
71 | 71 |
72 if (event->type() == EventTypeNames::click) { | 72 if (event->type() == EventTypeNames::click) { |
73 if (renderer() && renderer()->visibleToHitTesting()) { | 73 if (layoutObject() && layoutObject()->visibleToHitTesting()) { |
74 m_clearButtonOwner->focusAndSelectClearButtonOwner(); | 74 m_clearButtonOwner->focusAndSelectClearButtonOwner(); |
75 m_clearButtonOwner->clearValue(); | 75 m_clearButtonOwner->clearValue(); |
76 event->setDefaultHandled(); | 76 event->setDefaultHandled(); |
77 } | 77 } |
78 } | 78 } |
79 | 79 |
80 if (!event->defaultHandled()) | 80 if (!event->defaultHandled()) |
81 HTMLDivElement::defaultEventHandler(event); | 81 HTMLDivElement::defaultEventHandler(event); |
82 } | 82 } |
83 | 83 |
84 bool ClearButtonElement::isClearButtonElement() const | 84 bool ClearButtonElement::isClearButtonElement() const |
85 { | 85 { |
86 return true; | 86 return true; |
87 } | 87 } |
88 | 88 |
89 DEFINE_TRACE(ClearButtonElement) | 89 DEFINE_TRACE(ClearButtonElement) |
90 { | 90 { |
91 visitor->trace(m_clearButtonOwner); | 91 visitor->trace(m_clearButtonOwner); |
92 HTMLDivElement::trace(visitor); | 92 HTMLDivElement::trace(visitor); |
93 } | 93 } |
94 | 94 |
95 } | 95 } |
OLD | NEW |