| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
| 3 * Copyright (C) 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 4 * Copyright (C) 2012 Samsung Electronics. All rights reserved. | 4 * Copyright (C) 2012 Samsung Electronics. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 MouseEvent* mouseEvent = toMouseEvent(event->underlyingEvent()); | 103 MouseEvent* mouseEvent = toMouseEvent(event->underlyingEvent()); |
| 104 if (!mouseEvent->hasPosition()) | 104 if (!mouseEvent->hasPosition()) |
| 105 return IntPoint(); | 105 return IntPoint(); |
| 106 return IntPoint(mouseEvent->offsetX(), mouseEvent->offsetY()); | 106 return IntPoint(mouseEvent->offsetX(), mouseEvent->offsetY()); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void ImageInputType::handleDOMActivateEvent(Event* event) | 109 void ImageInputType::handleDOMActivateEvent(Event* event) |
| 110 { | 110 { |
| 111 if (element().isDisabledFormControl() || !element().form()) | 111 if (element().isDisabledFormControl() || !element().form()) |
| 112 return; | 112 return; |
| 113 element().setActivatedSubmit(true); | |
| 114 m_clickLocation = extractClickLocation(event); | 113 m_clickLocation = extractClickLocation(event); |
| 115 element().form()->prepareForSubmission(event); // Event handlers can run. | 114 element().form()->prepareForSubmission(event, &element()); // Event handlers
can run. |
| 116 element().setActivatedSubmit(false); | |
| 117 event->setDefaultHandled(); | 115 event->setDefaultHandled(); |
| 118 } | 116 } |
| 119 | 117 |
| 120 LayoutObject* ImageInputType::createLayoutObject(const ComputedStyle& style) con
st | 118 LayoutObject* ImageInputType::createLayoutObject(const ComputedStyle& style) con
st |
| 121 { | 119 { |
| 122 if (m_useFallbackContent) | 120 if (m_useFallbackContent) |
| 123 return new LayoutBlockFlow(&element()); | 121 return new LayoutBlockFlow(&element()); |
| 124 LayoutImage* image = new LayoutImage(&element()); | 122 LayoutImage* image = new LayoutImage(&element()); |
| 125 image->setImageResource(LayoutImageResource::create()); | 123 image->setImageResource(LayoutImageResource::create()); |
| 126 return image; | 124 return image; |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 | 285 |
| 288 PassRefPtr<ComputedStyle> ImageInputType::customStyleForLayoutObject(PassRefPtr<
ComputedStyle> newStyle) | 286 PassRefPtr<ComputedStyle> ImageInputType::customStyleForLayoutObject(PassRefPtr<
ComputedStyle> newStyle) |
| 289 { | 287 { |
| 290 if (!m_useFallbackContent) | 288 if (!m_useFallbackContent) |
| 291 return newStyle; | 289 return newStyle; |
| 292 | 290 |
| 293 return HTMLImageFallbackHelper::customStyleForAltText(element(), std::move(n
ewStyle)); | 291 return HTMLImageFallbackHelper::customStyleForAltText(element(), std::move(n
ewStyle)); |
| 294 } | 292 } |
| 295 | 293 |
| 296 } // namespace blink | 294 } // namespace blink |
| OLD | NEW |