| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple 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 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 #include "core/loader/FrameLoader.h" | 110 #include "core/loader/FrameLoader.h" |
| 111 #include "core/loader/HistoryItem.h" | 111 #include "core/loader/HistoryItem.h" |
| 112 #include "core/page/ChromeClient.h" | 112 #include "core/page/ChromeClient.h" |
| 113 #include "core/page/FocusController.h" | 113 #include "core/page/FocusController.h" |
| 114 #include "core/page/NetworkStateNotifier.h" | 114 #include "core/page/NetworkStateNotifier.h" |
| 115 #include "core/page/Page.h" | 115 #include "core/page/Page.h" |
| 116 #include "core/page/PrintContext.h" | 116 #include "core/page/PrintContext.h" |
| 117 #include "core/paint/DeprecatedPaintLayer.h" | 117 #include "core/paint/DeprecatedPaintLayer.h" |
| 118 #include "core/plugins/testing/DictionaryPluginPlaceholder.h" | 118 #include "core/plugins/testing/DictionaryPluginPlaceholder.h" |
| 119 #include "core/plugins/testing/DocumentFragmentPluginPlaceholder.h" | 119 #include "core/plugins/testing/DocumentFragmentPluginPlaceholder.h" |
| 120 #include "core/svg/SVGImageElement.h" |
| 120 #include "core/testing/DictionaryTest.h" | 121 #include "core/testing/DictionaryTest.h" |
| 121 #include "core/testing/GCObservation.h" | 122 #include "core/testing/GCObservation.h" |
| 122 #include "core/testing/InternalRuntimeFlags.h" | 123 #include "core/testing/InternalRuntimeFlags.h" |
| 123 #include "core/testing/InternalSettings.h" | 124 #include "core/testing/InternalSettings.h" |
| 124 #include "core/testing/LayerRect.h" | 125 #include "core/testing/LayerRect.h" |
| 125 #include "core/testing/LayerRectList.h" | 126 #include "core/testing/LayerRectList.h" |
| 126 #include "core/testing/PluginPlaceholderOptions.h" | 127 #include "core/testing/PluginPlaceholderOptions.h" |
| 127 #include "core/testing/PrivateScriptTest.h" | 128 #include "core/testing/PrivateScriptTest.h" |
| 128 #include "core/testing/TypeConversions.h" | 129 #include "core/testing/TypeConversions.h" |
| 129 #include "core/testing/UnionTypesTest.h" | 130 #include "core/testing/UnionTypesTest.h" |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 } | 479 } |
| 479 | 480 |
| 480 void Internals::advanceTimeForImage(Element* image, double deltaTimeInSeconds, E
xceptionState& exceptionState) | 481 void Internals::advanceTimeForImage(Element* image, double deltaTimeInSeconds, E
xceptionState& exceptionState) |
| 481 { | 482 { |
| 482 ASSERT(image); | 483 ASSERT(image); |
| 483 if (deltaTimeInSeconds < 0) { | 484 if (deltaTimeInSeconds < 0) { |
| 484 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::
indexExceedsMinimumBound("deltaTimeInSeconds", deltaTimeInSeconds, 0.0)); | 485 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::
indexExceedsMinimumBound("deltaTimeInSeconds", deltaTimeInSeconds, 0.0)); |
| 485 return; | 486 return; |
| 486 } | 487 } |
| 487 | 488 |
| 488 if (!isHTMLImageElement(*image)) { | 489 ImageResource* resource = nullptr; |
| 490 if (isHTMLImageElement(*image)) { |
| 491 resource = toHTMLImageElement(*image).cachedImage(); |
| 492 } else if (isSVGImageElement(*image)) { |
| 493 resource = toSVGImageElement(*image).cachedImage(); |
| 494 } else { |
| 489 exceptionState.throwDOMException(InvalidAccessError, "The element provid
ed is not a image element."); | 495 exceptionState.throwDOMException(InvalidAccessError, "The element provid
ed is not a image element."); |
| 490 return; | 496 return; |
| 491 } | 497 } |
| 492 | 498 |
| 493 ImageResource* resource = toHTMLImageElement(*image).cachedImage(); | |
| 494 if (!resource || !resource->hasImage()) { | 499 if (!resource || !resource->hasImage()) { |
| 495 exceptionState.throwDOMException(InvalidAccessError, "The image resource
is not available."); | 500 exceptionState.throwDOMException(InvalidAccessError, "The image resource
is not available."); |
| 496 return; | 501 return; |
| 497 } | 502 } |
| 498 | 503 |
| 499 Image* imageData = resource->image(); | 504 Image* imageData = resource->image(); |
| 500 if (!imageData->isBitmapImage()) { | 505 if (!imageData->isBitmapImage()) { |
| 501 exceptionState.throwDOMException(InvalidAccessError, "The image resource
is not a BitmapImage type."); | 506 exceptionState.throwDOMException(InvalidAccessError, "The image resource
is not a BitmapImage type."); |
| 502 return; | 507 return; |
| 503 } | 508 } |
| (...skipping 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2440 return ClientRectList::create(rects); | 2445 return ClientRectList::create(rects); |
| 2441 } | 2446 } |
| 2442 | 2447 |
| 2443 void Internals::setCapsLockState(bool enabled) | 2448 void Internals::setCapsLockState(bool enabled) |
| 2444 { | 2449 { |
| 2445 PlatformKeyboardEvent::setCurrentCapsLockState(enabled ? | 2450 PlatformKeyboardEvent::setCurrentCapsLockState(enabled ? |
| 2446 PlatformKeyboardEvent::OverrideCapsLockState::On : PlatformKeyboardEvent
::OverrideCapsLockState::Off); | 2451 PlatformKeyboardEvent::OverrideCapsLockState::On : PlatformKeyboardEvent
::OverrideCapsLockState::Off); |
| 2447 } | 2452 } |
| 2448 | 2453 |
| 2449 } // namespace blink | 2454 } // namespace blink |
| OLD | NEW |