| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple 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 * | 7 * |
| 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 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 } else if (isHTMLCanvasElement(node)) { | 889 } else if (isHTMLCanvasElement(node)) { |
| 890 imageBitmap = ImageBitmap::create(toHTMLCanvasElement(node), | 890 imageBitmap = ImageBitmap::create(toHTMLCanvasElement(node), |
| 891 Optional<IntRect>(), options); | 891 Optional<IntRect>(), options); |
| 892 } else if (isHTMLVideoElement(node)) { | 892 } else if (isHTMLVideoElement(node)) { |
| 893 imageBitmap = ImageBitmap::create(toHTMLVideoElement(node), | 893 imageBitmap = ImageBitmap::create(toHTMLVideoElement(node), |
| 894 Optional<IntRect>(), document, options); | 894 Optional<IntRect>(), document, options); |
| 895 } | 895 } |
| 896 if (!imageBitmap) | 896 if (!imageBitmap) |
| 897 return String(); | 897 return String(); |
| 898 | 898 |
| 899 StaticBitmapImage* bitmapImage = imageBitmap->bitmapImage(); |
| 900 if (!bitmapImage) |
| 901 return String(); |
| 902 |
| 899 // TODO(ccameron): AXLayoutObject::imageDataUrl should create sRGB images. | 903 // TODO(ccameron): AXLayoutObject::imageDataUrl should create sRGB images. |
| 900 sk_sp<SkImage> image = imageBitmap->bitmapImage()->imageForCurrentFrame( | 904 sk_sp<SkImage> image = bitmapImage->imageForCurrentFrame( |
| 901 ColorBehavior::transformToGlobalTarget()); | 905 ColorBehavior::transformToGlobalTarget()); |
| 902 if (!image || image->width() <= 0 || image->height() <= 0) | 906 if (!image || image->width() <= 0 || image->height() <= 0) |
| 903 return String(); | 907 return String(); |
| 904 | 908 |
| 905 // Determine the width and height of the output image, using a proportional | 909 // Determine the width and height of the output image, using a proportional |
| 906 // scale factor such that it's no larger than |maxSize|, if |maxSize| is not | 910 // scale factor such that it's no larger than |maxSize|, if |maxSize| is not |
| 907 // empty. It only resizes the image to be smaller (if necessary), not | 911 // empty. It only resizes the image to be smaller (if necessary), not |
| 908 // larger. | 912 // larger. |
| 909 float xScale = maxSize.width() ? maxSize.width() * 1.0 / image->width() : 1.0; | 913 float xScale = maxSize.width() ? maxSize.width() * 1.0 / image->width() : 1.0; |
| 910 float yScale = | 914 float yScale = |
| (...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2482 | 2486 |
| 2483 bool AXLayoutObject::elementAttributeValue( | 2487 bool AXLayoutObject::elementAttributeValue( |
| 2484 const QualifiedName& attributeName) const { | 2488 const QualifiedName& attributeName) const { |
| 2485 if (!m_layoutObject) | 2489 if (!m_layoutObject) |
| 2486 return false; | 2490 return false; |
| 2487 | 2491 |
| 2488 return equalIgnoringCase(getAttribute(attributeName), "true"); | 2492 return equalIgnoringCase(getAttribute(attributeName), "true"); |
| 2489 } | 2493 } |
| 2490 | 2494 |
| 2491 } // namespace blink | 2495 } // namespace blink |
| OLD | NEW |