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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 | 505 |
506 Image* imageData = resource->image(); | 506 Image* imageData = resource->image(); |
507 if (!imageData->isBitmapImage()) { | 507 if (!imageData->isBitmapImage()) { |
508 exceptionState.throwDOMException(InvalidAccessError, "The image resource
is not a BitmapImage type."); | 508 exceptionState.throwDOMException(InvalidAccessError, "The image resource
is not a BitmapImage type."); |
509 return; | 509 return; |
510 } | 510 } |
511 | 511 |
512 imageData->advanceTime(deltaTimeInSeconds); | 512 imageData->advanceTime(deltaTimeInSeconds); |
513 } | 513 } |
514 | 514 |
| 515 void Internals::advanceImageAnimation(Element* image, ExceptionState& exceptionS
tate) |
| 516 { |
| 517 ASSERT(image); |
| 518 |
| 519 ImageResource* resource = nullptr; |
| 520 if (isHTMLImageElement(*image)) { |
| 521 resource = toHTMLImageElement(*image).cachedImage(); |
| 522 } else if (isSVGImageElement(*image)) { |
| 523 resource = toSVGImageElement(*image).cachedImage(); |
| 524 } else { |
| 525 exceptionState.throwDOMException(InvalidAccessError, "The element provid
ed is not a image element."); |
| 526 return; |
| 527 } |
| 528 |
| 529 if (!resource || !resource->hasImage()) { |
| 530 exceptionState.throwDOMException(InvalidAccessError, "The image resource
is not available."); |
| 531 return; |
| 532 } |
| 533 |
| 534 Image* imageData = resource->image(); |
| 535 imageData->advanceAnimationForTesting(); |
| 536 } |
| 537 |
515 bool Internals::hasShadowInsertionPoint(const Node* root, ExceptionState& except
ionState) const | 538 bool Internals::hasShadowInsertionPoint(const Node* root, ExceptionState& except
ionState) const |
516 { | 539 { |
517 ASSERT(root); | 540 ASSERT(root); |
518 if (!root->isShadowRoot()) { | 541 if (!root->isShadowRoot()) { |
519 exceptionState.throwDOMException(InvalidAccessError, "The node argument
is not a shadow root."); | 542 exceptionState.throwDOMException(InvalidAccessError, "The node argument
is not a shadow root."); |
520 return false; | 543 return false; |
521 } | 544 } |
522 return toShadowRoot(root)->containsShadowElements(); | 545 return toShadowRoot(root)->containsShadowElements(); |
523 } | 546 } |
524 | 547 |
(...skipping 1967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2492 | 2515 |
2493 return animator->setScrollbarsVisibleForTesting(visible); | 2516 return animator->setScrollbarsVisibleForTesting(visible); |
2494 } | 2517 } |
2495 | 2518 |
2496 void Internals::forceRestrictIFramePermissions() | 2519 void Internals::forceRestrictIFramePermissions() |
2497 { | 2520 { |
2498 RuntimeEnabledFeatures::setRestrictIFramePermissionsEnabled(true); | 2521 RuntimeEnabledFeatures::setRestrictIFramePermissionsEnabled(true); |
2499 } | 2522 } |
2500 | 2523 |
2501 } // namespace blink | 2524 } // namespace blink |
OLD | NEW |