| Differences between
and this patch
- a/Source/WebCore/ChangeLog +38 lines
Lines 1-5 a/Source/WebCore/ChangeLog_sec1
1
2013-07-09  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1
2013-07-09  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2
2
3
        [EFL] Enable CSS Image Orientation
4
        https://bugs.webkit.org/show_bug.cgi?id=118454
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        http://www.w3.org/TR/2012/CR-css3-images-20120417/#the-image-orientation
9
        The css3-images module is at candidate recommendation.
10
11
        No new tests; draft patch.
12
13
        * loader/cache/CachedImage.cpp:
14
        (WebCore::CachedImage::imageSizeForRenderer):
15
        * page/DragController.cpp:
16
        (WebCore::DragController::doImageDrag):
17
        * page/Frame.cpp:
18
        (WebCore::Frame::nodeImage):
19
        * platform/graphics/BitmapImage.cpp:
20
        (WebCore::BitmapImage::updateSize):
21
        (WebCore::BitmapImage::sizeRespectingOrientation):
22
        * platform/graphics/BitmapImage.h:
23
        (BitmapImage):
24
        * platform/graphics/GraphicsContext.cpp:
25
        (WebCore::GraphicsContext::drawImage):
26
        * platform/graphics/cg/ImageCG.cpp:
27
        (WebCore::BitmapImage::draw):
28
        * platform/graphics/cg/ImageSourceCG.cpp:
29
        (WebCore::ImageSource::frameSizeAtIndex):
30
        * platform/mac/DragImageMac.mm:
31
        (WebCore::createDragImageFromImage):
32
        * rendering/RenderImage.cpp:
33
        (WebCore::RenderImage::styleDidChange):
34
        (WebCore::RenderImage::paintReplaced):
35
        (WebCore::RenderImage::paintIntoRect):
36
        * rendering/style/RenderStyle.cpp:
37
        (WebCore::RenderStyle::diff):
38
39
2013-07-09  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
40
3
        Use toSVGFontElement() instead of static_cast<SVGFontElement*>
41
        Use toSVGFontElement() instead of static_cast<SVGFontElement*>
4
        https://bugs.webkit.org/show_bug.cgi?id=118496
42
        https://bugs.webkit.org/show_bug.cgi?id=118496
5
43
- a/Source/WebCore/html/HTMLCanvasElement.cpp -3 / +7 lines
Lines 404-412 void HTMLCanvasElement::paint(GraphicsContext* context, const LayoutRect& r, boo a/Source/WebCore/html/HTMLCanvasElement.cpp_sec1
404
    if (hasCreatedImageBuffer()) {
404
    if (hasCreatedImageBuffer()) {
405
        ImageBuffer* imageBuffer = buffer();
405
        ImageBuffer* imageBuffer = buffer();
406
        if (imageBuffer) {
406
        if (imageBuffer) {
407
            if (m_presentedImage)
407
            if (m_presentedImage) {
408
                context->drawImage(m_presentedImage.get(), ColorSpaceDeviceRGB, pixelSnappedIntRect(r), CompositeSourceOver, DoNotRespectImageOrientation, useLowQualityScale);
408
                ImageOrientationEnum orientation = DefaultImageOrientation;
409
            else
409
#if ENABLE(CSS_IMAGE_ORIENTATION)
410
                orientation = renderer()->style()->imageOrientation(); 
411
#endif
412
                context->drawImage(m_presentedImage.get(), ColorSpaceDeviceRGB, pixelSnappedIntRect(r), CompositeSourceOver, orientation, DoNotRespectImageOrientation, useLowQualityScale);
413
            } else
410
                context->drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, pixelSnappedIntRect(r), CompositeSourceOver, BlendModeNormal, useLowQualityScale);
414
                context->drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, pixelSnappedIntRect(r), CompositeSourceOver, BlendModeNormal, useLowQualityScale);
411
        }
415
        }
412
    }
416
    }
- a/Source/WebCore/loader/cache/CachedImage.cpp -2 / +12 lines
Lines 254-261 LayoutSize CachedImage::imageSizeForRenderer(const RenderObject* renderer, float a/Source/WebCore/loader/cache/CachedImage.cpp_sec1
254
254
255
    LayoutSize imageSize;
255
    LayoutSize imageSize;
256
256
257
    if (m_image->isBitmapImage() && (renderer && renderer->shouldRespectImageOrientation() == RespectImageOrientation))
257
    RespectImageOrientationEnum shouldRespectImageOrientation = DoNotRespectImageOrientation;
258
        imageSize = static_cast<BitmapImage*>(m_image.get())->sizeRespectingOrientation();
258
    if (renderer)
259
        shouldRespectImageOrientation = renderer->shouldRespectImageOrientation();
260
261
    ImageOrientationEnum orientation = DefaultImageOrientation;
262
#if ENABLE(CSS_IMAGE_ORIENTATION)
263
    if (renderer && renderer->style())
264
        orientation = renderer->style()->imageOrientation();
265
#endif
266
    if (m_image->isBitmapImage() && (shouldRespectImageOrientation == RespectImageOrientation || orientation != DefaultImageOrientation))
267
        imageSize = static_cast<BitmapImage*>(m_image.get())->sizeRespectingOrientation(orientation, shouldRespectImageOrientation);
268
259
#if ENABLE(SVG)
269
#if ENABLE(SVG)
260
    else if (m_image->isSVGImage()) {
270
    else if (m_image->isSVGImage()) {
261
        imageSize = m_svgImageCache->imageSizeForRenderer(renderer);
271
        imageSize = m_svgImageCache->imageSizeForRenderer(renderer);
- a/Source/WebCore/page/DragController.cpp -1 / +6 lines
Lines 875-882 void DragController::doImageDrag(Element* element, const IntPoint& dragOrigin, c a/Source/WebCore/page/DragController.cpp_sec1
875
    IntPoint origin;
875
    IntPoint origin;
876
876
877
    Image* image = getImage(element);
877
    Image* image = getImage(element);
878
    ImageOrientationEnum orientation = DefaultImageOrientation;
879
#if ENABLE(CSS_IMAGE_ORIENTATION)
880
    if (element->renderer() && element->renderer()->style())
881
        orientation = element->renderer()->style()->imageOrientation();
882
#endif
878
    if (image && image->size().height() * image->size().width() <= MaxOriginalImageArea
883
    if (image && image->size().height() * image->size().width() <= MaxOriginalImageArea
879
        && (dragImage = createDragImageFromImage(image, element->renderer() ? element->renderer()->shouldRespectImageOrientation() : DoNotRespectImageOrientation))) {
884
        && (dragImage = createDragImageFromImage(image, orientation, element->renderer() ? element->renderer()->shouldRespectImageOrientation() : DoNotRespectImageOrientation))) {
880
        IntSize originalSize = rect.size();
885
        IntSize originalSize = rect.size();
881
        origin = rect.location();
886
        origin = rect.location();
882
887
- a/Source/WebCore/page/Frame.cpp -2 / +8 lines
Lines 1093-1099 DragImageRef Frame::nodeImage(Node* node) a/Source/WebCore/page/Frame.cpp_sec1
1093
    m_view->paintContents(buffer->context(), paintingRect);
1093
    m_view->paintContents(buffer->context(), paintingRect);
1094
1094
1095
    RefPtr<Image> image = buffer->copyImage();
1095
    RefPtr<Image> image = buffer->copyImage();
1096
    return createDragImageFromImage(image.get(), renderer->shouldRespectImageOrientation());
1096
1097
    ImageOrientationEnum orientation = DefaultImageOrientation;
1098
#if ENABLE(CSS_IMAGE_ORIENTATION)
1099
    if (renderer->style())
1100
        orientation = renderer->style()->imageOrientation();
1101
#endif
1102
    return createDragImageFromImage(image.get(), orientation, renderer->shouldRespectImageOrientation());
1097
}
1103
}
1098
1104
1099
DragImageRef Frame::dragImageForSelection()
1105
DragImageRef Frame::dragImageForSelection()
Lines 1122-1128 DragImageRef Frame::dragImageForSelection() a/Source/WebCore/page/Frame.cpp_sec2
1122
    m_view->paintContents(buffer->context(), paintingRect);
1128
    m_view->paintContents(buffer->context(), paintingRect);
1123
1129
1124
    RefPtr<Image> image = buffer->copyImage();
1130
    RefPtr<Image> image = buffer->copyImage();
1125
    return createDragImageFromImage(image.get());
1131
    return createDragImageFromImage(image.get(), DefaultImageOrientation);
1126
}
1132
}
1127
1133
1128
#endif
1134
#endif
- a/Source/WebCore/platform/DragImage.h -2 / +2 lines
Lines 74-81 namespace WebCore { a/Source/WebCore/platform/DragImage.h_sec1
74
    DragImageRef fitDragImageToMaxSize(DragImageRef image, const IntSize& srcSize, const IntSize& size);
74
    DragImageRef fitDragImageToMaxSize(DragImageRef image, const IntSize& srcSize, const IntSize& size);
75
    DragImageRef scaleDragImage(DragImageRef, FloatSize scale);
75
    DragImageRef scaleDragImage(DragImageRef, FloatSize scale);
76
    DragImageRef dissolveDragImageToFraction(DragImageRef image, float delta);
76
    DragImageRef dissolveDragImageToFraction(DragImageRef image, float delta);
77
    
77
78
    DragImageRef createDragImageFromImage(Image*, RespectImageOrientationEnum = DoNotRespectImageOrientation);
78
    DragImageRef createDragImageFromImage(Image*, ImageOrientationEnum = DefaultImageOrientation, RespectImageOrientationEnum = DoNotRespectImageOrientation);
79
    DragImageRef createDragImageIconForCachedImageFilename(const String&);
79
    DragImageRef createDragImageIconForCachedImageFilename(const String&);
80
    DragImageRef createDragImageForLink(KURL&, const String& label, FontRenderingMode);
80
    DragImageRef createDragImageForLink(KURL&, const String& label, FontRenderingMode);
81
    void deleteDragImage(DragImageRef);
81
    void deleteDragImage(DragImageRef);
- a/Source/WebCore/platform/blackberry/DragImageBlackBerry.cpp -1 / +1 lines
Lines 25-31 a/Source/WebCore/platform/blackberry/DragImageBlackBerry.cpp_sec1
25
25
26
namespace WebCore {
26
namespace WebCore {
27
27
28
void* createDragImageFromImage(Image*, RespectImageOrientationEnum)
28
void* createDragImageFromImage(Image*, ImageOrientationEnum, RespectImageOrientationEnum)
29
{
29
{
30
    notImplemented();
30
    notImplemented();
31
    return 0;
31
    return 0;
- a/Source/WebCore/platform/efl/DragImageEfl.cpp -1 / +1 lines
Lines 49-55 DragImageRef dissolveDragImageToFraction(DragImageRef image, float) a/Source/WebCore/platform/efl/DragImageEfl.cpp_sec1
49
    return image;
49
    return image;
50
}
50
}
51
51
52
DragImageRef createDragImageFromImage(Image*, RespectImageOrientationEnum)
52
DragImageRef createDragImageFromImage(Image*, ImageOrientationEnum, RespectImageOrientationEnum)
53
{
53
{
54
    notImplemented();
54
    notImplemented();
55
    return 0;
55
    return 0;
- a/Source/WebCore/platform/graphics/BitmapImage.cpp -5 / +9 lines
Lines 179-191 void BitmapImage::didDecodeProperties() const a/Source/WebCore/platform/graphics/BitmapImage.cpp_sec1
179
        imageObserver()->decodedSizeChanged(this, deltaBytes);
179
        imageObserver()->decodedSizeChanged(this, deltaBytes);
180
}
180
}
181
181
182
void BitmapImage::updateSize() const
182
void BitmapImage::updateSize(ImageOrientationEnum orientation, RespectImageOrientationEnum shouldRespectImageOrientation) const
183
{
183
{
184
    if (!m_sizeAvailable || m_haveSize)
184
    if (!m_sizeAvailable || (m_haveSize
185
        && orientation == static_cast<ImageOrientationEnum>(m_orientation)
186
        && shouldRespectImageOrientation == static_cast<RespectImageOrientationEnum>(m_shouldRespectImageOrientation)))
185
        return;
187
        return;
186
188
187
    m_size = m_source.size();
189
    m_size = m_source.size();
188
    m_sizeRespectingOrientation = m_source.size(RespectImageOrientation);
190
    m_sizeRespectingOrientation = m_source.size(orientation, shouldRespectImageOrientation);
191
    m_orientation = static_cast<unsigned>(orientation);
192
    m_shouldRespectImageOrientation = static_cast<unsigned>(shouldRespectImageOrientation);
189
    m_haveSize = true;
193
    m_haveSize = true;
190
    didDecodeProperties();
194
    didDecodeProperties();
191
}
195
}
Lines 196-204 IntSize BitmapImage::size() const a/Source/WebCore/platform/graphics/BitmapImage.cpp_sec2
196
    return m_size;
200
    return m_size;
197
}
201
}
198
202
199
IntSize BitmapImage::sizeRespectingOrientation() const
203
IntSize BitmapImage::sizeRespectingOrientation(ImageOrientationEnum orientation, RespectImageOrientationEnum shouldRespectImageOrientation) const
200
{
204
{
201
    updateSize();
205
    updateSize(orientation, shouldRespectImageOrientation);
202
    return m_sizeRespectingOrientation;
206
    return m_sizeRespectingOrientation;
203
}
207
}
204
208
- a/Source/WebCore/platform/graphics/BitmapImage.h -4 / +6 lines
Lines 118-124 public: a/Source/WebCore/platform/graphics/BitmapImage.h_sec1
118
    virtual bool hasSingleSecurityOrigin() const;
118
    virtual bool hasSingleSecurityOrigin() const;
119
119
120
    virtual IntSize size() const;
120
    virtual IntSize size() const;
121
    IntSize sizeRespectingOrientation() const;
121
    IntSize sizeRespectingOrientation(ImageOrientationEnum, RespectImageOrientationEnum) const;
122
    IntSize currentFrameSize() const;
122
    IntSize currentFrameSize() const;
123
    virtual bool getHotSpot(IntPoint&) const;
123
    virtual bool getHotSpot(IntPoint&) const;
124
124
Lines 174-180 public: a/Source/WebCore/platform/graphics/BitmapImage.h_sec2
174
    bool canAnimate();
174
    bool canAnimate();
175
175
176
private:
176
private:
177
    void updateSize() const;
177
    void updateSize(ImageOrientationEnum = DefaultImageOrientation, RespectImageOrientationEnum = DoNotRespectImageOrientation) const;
178
178
179
protected:
179
protected:
180
    enum RepetitionCountStatus {
180
    enum RepetitionCountStatus {
Lines 189-197 protected: a/Source/WebCore/platform/graphics/BitmapImage.h_sec3
189
#if PLATFORM(WIN)
189
#if PLATFORM(WIN)
190
    virtual void drawFrameMatchingSourceSize(GraphicsContext*, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator);
190
    virtual void drawFrameMatchingSourceSize(GraphicsContext*, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator);
191
#endif
191
#endif
192
    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode);
192
    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationEnum = DefaultImageOrientation);
193
#if USE(CG) || USE(CAIRO) || PLATFORM(BLACKBERRY)
193
#if USE(CG) || USE(CAIRO) || PLATFORM(BLACKBERRY)
194
    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, RespectImageOrientationEnum) OVERRIDE;
194
    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationEnum = DefaultImageOrientation, RespectImageOrientationEnum = DoNotRespectImageOrientation) OVERRIDE;
195
#endif
195
#endif
196
196
197
#if USE(WINGDI)
197
#if USE(WINGDI)
Lines 265-270 protected: a/Source/WebCore/platform/graphics/BitmapImage.h_sec4
265
    ImageSource m_source;
265
    ImageSource m_source;
266
    mutable IntSize m_size; // The size to use for the overall image (will just be the size of the first image).
266
    mutable IntSize m_size; // The size to use for the overall image (will just be the size of the first image).
267
    mutable IntSize m_sizeRespectingOrientation;
267
    mutable IntSize m_sizeRespectingOrientation;
268
    mutable unsigned m_orientation : 4; // ImageOrientationEnum
269
    mutable unsigned m_shouldRespectImageOrientation : 1; // RespectImageOrientationEnum
268
    
270
    
269
    size_t m_currentFrame; // The index of the current frame of animation.
271
    size_t m_currentFrame; // The index of the current frame of animation.
270
    Vector<FrameData, 1> m_frames; // An array of the cached frames of the animation. We have to ref frames to pin them in the cache.
272
    Vector<FrameData, 1> m_frames; // An array of the cached frames of the animation. We have to ref frames to pin them in the cache.
- a/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp -1 / +1 lines
Lines 80-86 void CrossfadeGeneratedImage::drawCrossfade(GraphicsContext* context) a/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp_sec1
80
    context->endTransparencyLayer();
80
    context->endTransparencyLayer();
81
}
81
}
82
82
83
void CrossfadeGeneratedImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode)
83
void CrossfadeGeneratedImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode, ImageOrientationEnum)
84
{
84
{
85
    GraphicsContextStateSaver stateSaver(*context);
85
    GraphicsContextStateSaver stateSaver(*context);
86
    context->setCompositeOperation(compositeOp);
86
    context->setCompositeOperation(compositeOp);
- a/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.h -1 / +1 lines
Lines 51-57 public: a/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.h_sec1
51
    virtual IntSize size() const { return m_crossfadeSize; }
51
    virtual IntSize size() const { return m_crossfadeSize; }
52
52
53
protected:
53
protected:
54
    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode);
54
    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationEnum = DefaultImageOrientation);
55
    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& dstRect, BlendMode);
55
    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& dstRect, BlendMode);
56
56
57
    CrossfadeGeneratedImage(Image* fromImage, Image* toImage, float percentage, IntSize crossfadeSize, const IntSize&);
57
    CrossfadeGeneratedImage(Image* fromImage, Image* toImage, float percentage, IntSize crossfadeSize, const IntSize&);
- a/Source/WebCore/platform/graphics/GeneratedImage.h -1 / +1 lines
Lines 50-56 public: a/Source/WebCore/platform/graphics/GeneratedImage.h_sec1
50
    virtual unsigned decodedSize() const { return 0; }
50
    virtual unsigned decodedSize() const { return 0; }
51
51
52
protected:
52
protected:
53
    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode) = 0;
53
    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationEnum = DefaultImageOrientation) = 0;
54
    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
54
    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
55
        const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode) = 0;
55
        const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode) = 0;
56
56
- a/Source/WebCore/platform/graphics/GeneratorGeneratedImage.cpp -1 / +1 lines
Lines 32-38 a/Source/WebCore/platform/graphics/GeneratorGeneratedImage.cpp_sec1
32
32
33
namespace WebCore {
33
namespace WebCore {
34
34
35
void GeneratorGeneratedImage::draw(GraphicsContext* destContext, const FloatRect& destRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode)
35
void GeneratorGeneratedImage::draw(GraphicsContext* destContext, const FloatRect& destRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationEnum orientation)
36
{
36
{
37
    GraphicsContextStateSaver stateSaver(*destContext);
37
    GraphicsContextStateSaver stateSaver(*destContext);
38
    destContext->setCompositeOperation(compositeOp, blendMode);
38
    destContext->setCompositeOperation(compositeOp, blendMode);
- a/Source/WebCore/platform/graphics/GeneratorGeneratedImage.h -1 / +1 lines
Lines 45-51 public: a/Source/WebCore/platform/graphics/GeneratorGeneratedImage.h_sec1
45
    virtual ~GeneratorGeneratedImage() { }
45
    virtual ~GeneratorGeneratedImage() { }
46
46
47
protected:
47
protected:
48
    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode);
48
    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationEnum = DefaultImageOrientation);
49
    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
49
    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
50
        const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode);
50
        const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode);
51
51
- a/Source/WebCore/platform/graphics/GraphicsContext.cpp -15 / +14 lines
Lines 34-41 a/Source/WebCore/platform/graphics/GraphicsContext.cpp_sec1
34
#include "RoundedRect.h"
34
#include "RoundedRect.h"
35
#include "TextRun.h"
35
#include "TextRun.h"
36
36
37
#include "stdio.h"
38
39
using namespace std;
37
using namespace std;
40
38
41
namespace WebCore {
39
namespace WebCore {
Lines 469-507 void GraphicsContext::drawHighlightForText(const Font& font, const TextRun& run, a/Source/WebCore/platform/graphics/GraphicsContext.cpp_sec2
469
    fillRect(font.selectionRectForText(run, point, h, from, to), backgroundColor, colorSpace);
467
    fillRect(font.selectionRectForText(run, point, h, from, to), backgroundColor, colorSpace);
470
}
468
}
471
469
472
void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const IntPoint& p, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation)
470
void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const IntPoint& p, CompositeOperator op, ImageOrientationEnum orientation, RespectImageOrientationEnum shouldRespectImageOrientation)
473
{
471
{
474
    if (!image)
472
    if (!image)
475
        return;
473
        return;
476
    drawImage(image, styleColorSpace, FloatRect(IntRect(p, image->size())), FloatRect(FloatPoint(), FloatSize(image->size())), op, shouldRespectImageOrientation);
474
    drawImage(image, styleColorSpace, FloatRect(IntRect(p, image->size())), FloatRect(FloatPoint(), FloatSize(image->size())), op, orientation, shouldRespectImageOrientation);
477
}
475
}
478
476
479
void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const IntRect& r, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation, bool useLowQualityScale)
477
void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const IntRect& r, CompositeOperator op, ImageOrientationEnum orientation, RespectImageOrientationEnum shouldRespectImageOrientation, bool useLowQualityScale)
480
{
478
{
481
    if (!image)
479
    if (!image)
482
        return;
480
        return;
483
    drawImage(image, styleColorSpace, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->size())), op, shouldRespectImageOrientation, useLowQualityScale);
481
    drawImage(image, styleColorSpace, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->size())), op, orientation, shouldRespectImageOrientation, useLowQualityScale);
484
}
482
}
485
483
486
void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const IntPoint& dest, const IntRect& srcRect, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation)
484
void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const IntPoint& dest, const IntRect& srcRect, CompositeOperator op, ImageOrientationEnum orientation, RespectImageOrientationEnum shouldRespectImageOrientation)
487
{
485
{
488
    drawImage(image, styleColorSpace, FloatRect(IntRect(dest, srcRect.size())), FloatRect(srcRect), op, shouldRespectImageOrientation);
486
    drawImage(image, styleColorSpace, FloatRect(IntRect(dest, srcRect.size())), FloatRect(srcRect), op, orientation, shouldRespectImageOrientation);
489
}
487
}
490
488
491
void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation, bool useLowQualityScale)
489
void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op, ImageOrientationEnum orientation, RespectImageOrientationEnum shouldRespectImageOrientation, bool useLowQualityScale)
492
{
490
{
493
    drawImage(image, styleColorSpace, dest, src, op, BlendModeNormal, shouldRespectImageOrientation, useLowQualityScale);
491
    drawImage(image, styleColorSpace, dest, src, op, BlendModeNormal, orientation, shouldRespectImageOrientation, useLowQualityScale);
494
}
492
}
495
493
496
void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatRect& dest)
494
void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatRect& dest, ImageOrientationEnum)
497
{
495
{
498
    if (!image)
496
    if (!image)
499
        return;
497
        return;
500
    drawImage(image, styleColorSpace, dest, FloatRect(IntRect(IntPoint(), image->size())));
498
    drawImage(image, styleColorSpace, dest, FloatRect(IntRect(IntPoint(), image->size())));
501
}
499
}
502
500
503
void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op, BlendMode blendMode, RespectImageOrientationEnum shouldRespectImageOrientation, bool useLowQualityScale)
501
void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op, BlendMode blendMode, ImageOrientationEnum orientation, RespectImageOrientationEnum shouldRespectImageOrientation, bool useLowQualityScale)
504
{    if (paintingDisabled() || !image)
502
{
503
    if (paintingDisabled() || !image)
505
        return;
504
        return;
506
505
507
    InterpolationQuality previousInterpolationQuality = InterpolationDefault;
506
    InterpolationQuality previousInterpolationQuality = InterpolationDefault;
Lines 512-518 void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const a/Source/WebCore/platform/graphics/GraphicsContext.cpp_sec3
512
        setImageInterpolationQuality(InterpolationNone);
511
        setImageInterpolationQuality(InterpolationNone);
513
    }
512
    }
514
513
515
    image->draw(this, dest, src, styleColorSpace, op, blendMode, shouldRespectImageOrientation);
514
    image->draw(this, dest, src, styleColorSpace, op, blendMode, orientation, shouldRespectImageOrientation);
516
515
517
    if (useLowQualityScale)
516
    if (useLowQualityScale)
518
        setImageInterpolationQuality(previousInterpolationQuality);
517
        setImageInterpolationQuality(previousInterpolationQuality);
Lines 540-546 void GraphicsContext::drawTiledImage(Image* image, ColorSpace styleColorSpace, c a/Source/WebCore/platform/graphics/GraphicsContext.cpp_sec4
540
539
541
    if (hRule == Image::StretchTile && vRule == Image::StretchTile) {
540
    if (hRule == Image::StretchTile && vRule == Image::StretchTile) {
542
        // Just do a scale.
541
        // Just do a scale.
543
        drawImage(image, styleColorSpace, dest, srcRect, op);
542
        drawImage(image, styleColorSpace, dest, srcRect, op, DefaultImageOrientation);
544
        return;
543
        return;
545
    }
544
    }
546
545
- a/Source/WebCore/platform/graphics/GraphicsContext.h -6 / +6 lines
Lines 287-298 namespace WebCore { a/Source/WebCore/platform/graphics/GraphicsContext.h_sec1
287
287
288
        void strokeRect(const FloatRect&, float lineWidth);
288
        void strokeRect(const FloatRect&, float lineWidth);
289
289
290
        void drawImage(Image*, ColorSpace styleColorSpace, const IntPoint&, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation);
290
        void drawImage(Image*, ColorSpace styleColorSpace, const IntPoint&, CompositeOperator = CompositeSourceOver, ImageOrientationEnum = DefaultImageOrientation, RespectImageOrientationEnum = DoNotRespectImageOrientation);
291
        void drawImage(Image*, ColorSpace styleColorSpace, const IntRect&, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation, bool useLowQualityScale = false);
291
        void drawImage(Image*, ColorSpace styleColorSpace, const IntRect&, CompositeOperator = CompositeSourceOver, ImageOrientationEnum = DefaultImageOrientation, RespectImageOrientationEnum = DoNotRespectImageOrientation, bool useLowQualityScale = false);
292
        void drawImage(Image*, ColorSpace styleColorSpace, const IntPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation);
292
        void drawImage(Image*, ColorSpace styleColorSpace, const IntPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, ImageOrientationEnum = DefaultImageOrientation, RespectImageOrientationEnum = DoNotRespectImageOrientation);
293
        void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect);
293
        void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect, ImageOrientationEnum = DefaultImageOrientation);
294
        void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation, bool useLowQualityScale = false);
294
        void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, ImageOrientationEnum = DefaultImageOrientation, RespectImageOrientationEnum = DoNotRespectImageOrientation, bool useLowQualityScale = false);
295
        void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator, BlendMode, RespectImageOrientationEnum = DoNotRespectImageOrientation, bool useLowQualityScale = false);
295
        void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator, BlendMode, ImageOrientationEnum = DefaultImageOrientation, RespectImageOrientationEnum = DoNotRespectImageOrientation, bool useLowQualityScale = false);
296
        
296
        
297
        void drawTiledImage(Image*, ColorSpace styleColorSpace, const IntRect& destRect, const IntPoint& srcPoint, const IntSize& tileSize,
297
        void drawTiledImage(Image*, ColorSpace styleColorSpace, const IntRect& destRect, const IntPoint& srcPoint, const IntSize& tileSize,
298
            CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false, BlendMode = BlendModeNormal);
298
            CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false, BlendMode = BlendModeNormal);
- a/Source/WebCore/platform/graphics/Image.cpp -2 / +2 lines
Lines 90-98 void Image::fillWithSolidColor(GraphicsContext* ctxt, const FloatRect& dstRect, a/Source/WebCore/platform/graphics/Image.cpp_sec1
90
    ctxt->setCompositeOperation(previousOperator);
90
    ctxt->setCompositeOperation(previousOperator);
91
}
91
}
92
92
93
void Image::draw(GraphicsContext* ctx, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode, RespectImageOrientationEnum)
93
void Image::draw(GraphicsContext* ctx, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode, ImageOrientationEnum orientation, RespectImageOrientationEnum)
94
{
94
{
95
    draw(ctx, dstRect, srcRect, styleColorSpace, op, blendMode);
95
    draw(ctx, dstRect, srcRect, styleColorSpace, op, blendMode, orientation);
96
}
96
}
97
97
98
void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode)
98
void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode)
- a/Source/WebCore/platform/graphics/Image.h -2 / +2 lines
Lines 195-202 protected: a/Source/WebCore/platform/graphics/Image.h_sec1
195
#if PLATFORM(WIN)
195
#if PLATFORM(WIN)
196
    virtual void drawFrameMatchingSourceSize(GraphicsContext*, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator) { }
196
    virtual void drawFrameMatchingSourceSize(GraphicsContext*, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator) { }
197
#endif
197
#endif
198
    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode) = 0;
198
    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationEnum = DefaultImageOrientation) = 0;
199
    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, RespectImageOrientationEnum);
199
    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationEnum, RespectImageOrientationEnum);
200
    void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize, ColorSpace styleColorSpace,
200
    void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize, ColorSpace styleColorSpace,
201
        CompositeOperator , BlendMode);
201
        CompositeOperator , BlendMode);
202
    void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, ColorSpace styleColorSpace, CompositeOperator);
202
    void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, ColorSpace styleColorSpace, CompositeOperator);
- a/Source/WebCore/platform/graphics/ImageSource.cpp -3 / +3 lines
Lines 99-110 bool ImageSource::isSizeAvailable() a/Source/WebCore/platform/graphics/ImageSource.cpp_sec1
99
    return m_decoder && m_decoder->isSizeAvailable();
99
    return m_decoder && m_decoder->isSizeAvailable();
100
}
100
}
101
101
102
IntSize ImageSource::size(RespectImageOrientationEnum shouldRespectOrientation) const
102
IntSize ImageSource::size(ImageOrientationEnum orientation, RespectImageOrientationEnum shouldRespectOrientation) const
103
{
103
{
104
    return frameSizeAtIndex(0, shouldRespectOrientation);
104
    return frameSizeAtIndex(0, orientation, shouldRespectOrientation);
105
}
105
}
106
106
107
IntSize ImageSource::frameSizeAtIndex(size_t index, RespectImageOrientationEnum shouldRespectOrientation) const
107
IntSize ImageSource::frameSizeAtIndex(size_t index, ImageOrientationEnum, RespectImageOrientationEnum shouldRespectOrientation) const
108
{
108
{
109
    if (!m_decoder)
109
    if (!m_decoder)
110
        return IntSize();
110
        return IntSize();
- a/Source/WebCore/platform/graphics/ImageSource.h -2 / +2 lines
Lines 132-139 public: a/Source/WebCore/platform/graphics/ImageSource.h_sec1
132
    String filenameExtension() const;
132
    String filenameExtension() const;
133
133
134
    bool isSizeAvailable();
134
    bool isSizeAvailable();
135
    IntSize size(RespectImageOrientationEnum = DoNotRespectImageOrientation) const;
135
    IntSize size(ImageOrientationEnum = DefaultImageOrientation, RespectImageOrientationEnum = DoNotRespectImageOrientation) const;
136
    IntSize frameSizeAtIndex(size_t, RespectImageOrientationEnum = DoNotRespectImageOrientation) const;
136
    IntSize frameSizeAtIndex(size_t, ImageOrientationEnum = DefaultImageOrientation, RespectImageOrientationEnum = DoNotRespectImageOrientation) const;
137
137
138
    bool getHotSpot(IntPoint&) const;
138
    bool getHotSpot(IntPoint&) const;
139
139
- a/Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp -8 / +8 lines
Lines 64-76 BitmapImage::BitmapImage(PassRefPtr<cairo_surface_t> nativeImage, ImageObserver* a/Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp_sec1
64
    checkForSolidColor();
64
    checkForSolidColor();
65
}
65
}
66
66
67
void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const FloatRect& src, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode)
67
void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const FloatRect& src, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode, ImageOrientationEnum orientation)
68
{
68
{
69
    draw(context, dst, src, styleColorSpace, op, blendMode, DoNotRespectImageOrientation);
69
    draw(context, dst, src, styleColorSpace, op, blendMode, orientation, DoNotRespectImageOrientation);
70
}
70
}
71
71
72
void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const FloatRect& src, ColorSpace styleColorSpace, CompositeOperator op,
72
void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const FloatRect& src, ColorSpace styleColorSpace, CompositeOperator op,
73
    BlendMode blendMode, RespectImageOrientationEnum shouldRespectImageOrientation)
73
    BlendMode blendMode, ImageOrientationEnum orientation, RespectImageOrientationEnum shouldRespectImageOrientation)
74
{
74
{
75
    if (!dst.width() || !dst.height() || !src.width() || !src.height())
75
    if (!dst.width() || !dst.height() || !src.width() || !src.height())
76
        return;
76
        return;
Lines 101-118 void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const Flo a/Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp_sec2
101
    FloatRect adjustedSrcRect(src);
101
    FloatRect adjustedSrcRect(src);
102
#endif
102
#endif
103
103
104
    ImageOrientation orientation = DefaultImageOrientation;
104
    ImageOrientation frameOrientation(orientation);
105
    if (shouldRespectImageOrientation == RespectImageOrientation)
105
    if (shouldRespectImageOrientation == RespectImageOrientation)
106
        orientation = frameOrientationAtIndex(m_currentFrame);
106
        frameOrientation = frameOrientationAtIndex(m_currentFrame);
107
107
108
    FloatRect dstRect = dst;
108
    FloatRect dstRect = dst;
109
109
110
    if (orientation != DefaultImageOrientation) {
110
    if (frameOrientation != DefaultImageOrientation) {
111
        // ImageOrientation expects the origin to be at (0, 0).
111
        // ImageOrientation expects the origin to be at (0, 0).
112
        context->translate(dstRect.x(), dstRect.y());
112
        context->translate(dstRect.x(), dstRect.y());
113
        dstRect.setLocation(FloatPoint());
113
        dstRect.setLocation(FloatPoint());
114
        context->concatCTM(orientation.transformFromDefault(dstRect.size()));
114
        context->concatCTM(frameOrientation.transformFromDefault(dstRect.size()));
115
        if (orientation.usesWidthAsHeight()) {
115
        if (frameOrientation.usesWidthAsHeight()) {
116
            // The destination rectangle will have it's width and height already reversed for the orientation of
116
            // The destination rectangle will have it's width and height already reversed for the orientation of
117
            // the image, as it was needed for page layout, so we need to reverse it back here.
117
            // the image, as it was needed for page layout, so we need to reverse it back here.
118
            dstRect = FloatRect(dstRect.x(), dstRect.y(), dstRect.height(), dstRect.width());
118
            dstRect = FloatRect(dstRect.x(), dstRect.y(), dstRect.height(), dstRect.width());
- a/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp -1 / +1 lines
Lines 147-153 void ImageBuffer::draw(GraphicsContext* destinationContext, ColorSpace styleColo a/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp_sec1
147
{
147
{
148
    BackingStoreCopy copyMode = destinationContext == context() ? CopyBackingStore : DontCopyBackingStore;
148
    BackingStoreCopy copyMode = destinationContext == context() ? CopyBackingStore : DontCopyBackingStore;
149
    RefPtr<Image> image = copyImage(copyMode);
149
    RefPtr<Image> image = copyImage(copyMode);
150
    destinationContext->drawImage(image.get(), styleColorSpace, destRect, srcRect, op, blendMode, DoNotRespectImageOrientation, useLowQualityScale);
150
    destinationContext->drawImage(image.get(), styleColorSpace, destRect, srcRect, op, blendMode, DefaultImageOrientation, DoNotRespectImageOrientation, useLowQualityScale);
151
}
151
}
152
152
153
void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform,
153
void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform,
- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp -1 / +1 lines
Lines 442-448 void MediaPlayerPrivateGStreamerBase::paint(GraphicsContext* context, const IntR a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp_sec1
442
    }
442
    }
443
443
444
    context->drawImage(reinterpret_cast<Image*>(gstImage->image().get()), ColorSpaceSRGB,
444
    context->drawImage(reinterpret_cast<Image*>(gstImage->image().get()), ColorSpaceSRGB,
445
        rect, gstImage->rect(), CompositeCopy, DoNotRespectImageOrientation, false);
445
        rect, gstImage->rect(), CompositeCopy, DefaultImageOrientation, DoNotRespectImageOrientation, false);
446
    g_mutex_unlock(m_bufferMutex);
446
    g_mutex_unlock(m_bufferMutex);
447
}
447
}
448
448
- a/Source/WebCore/platform/graphics/qt/StillImageQt.h -1 / +1 lines
Lines 53-59 namespace WebCore { a/Source/WebCore/platform/graphics/qt/StillImageQt.h_sec1
53
53
54
        virtual IntSize size() const;
54
        virtual IntSize size() const;
55
        virtual PassNativeImagePtr nativeImageForCurrentFrame();
55
        virtual PassNativeImagePtr nativeImageForCurrentFrame();
56
        virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode);
56
        virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationEnum);
57
57
58
    private:
58
    private:
59
        StillImage(const QPixmap&);
59
        StillImage(const QPixmap&);
- a/Source/WebCore/platform/gtk/ClipboardGtk.cpp -1 / +1 lines
Lines 31-37 DragImageRef Clipboard::createDragImage(IntPoint& location) const a/Source/WebCore/platform/gtk/ClipboardGtk.cpp_sec1
31
    location = m_dragLoc;
31
    location = m_dragLoc;
32
32
33
    if (m_dragImage)
33
    if (m_dragImage)
34
        return createDragImageFromImage(m_dragImage->image());
34
        return createDragImageFromImage(m_dragImage->image(), DefaultImageOrientation);
35
35
36
    if (m_dragImageElement) {
36
    if (m_dragImageElement) {
37
        Document* document = m_dragImageElement->document();
37
        Document* document = m_dragImageElement->document();
- a/Source/WebCore/platform/gtk/DragImageGtk.cpp -1 / +1 lines
Lines 76-82 DragImageRef dissolveDragImageToFraction(DragImageRef image, float fraction) a/Source/WebCore/platform/gtk/DragImageGtk.cpp_sec1
76
    return image;
76
    return image;
77
}
77
}
78
78
79
DragImageRef createDragImageFromImage(Image* image, RespectImageOrientationEnum)
79
DragImageRef createDragImageFromImage(Image* image, ImageOrientationEnum, RespectImageOrientationEnum)
80
{
80
{
81
    return image->nativeImageForCurrentFrame().leakRef();
81
    return image->nativeImageForCurrentFrame().leakRef();
82
}
82
}
- a/Source/WebCore/platform/mac/DragImageMac.mm -8 / +8 lines
Lines 77-95 RetainPtr<NSImage> dissolveDragImageToFraction(RetainPtr<NSImage> image, float d a/Source/WebCore/platform/mac/DragImageMac.mm_sec1
77
    return dissolvedImage;
77
    return dissolvedImage;
78
}
78
}
79
        
79
        
80
RetainPtr<NSImage> createDragImageFromImage(Image* image, RespectImageOrientationEnum shouldRespectImageOrientation)
80
RetainPtr<NSImage> createDragImageFromImage(Image* image, ImageOrientationEnum orientation, RespectImageOrientationEnum shouldRespectImageOrientation)
81
{
81
{
82
    IntSize size = image->size();
82
    IntSize size = image->size();
83
83
84
    if (image->isBitmapImage()) {
84
    if (image->isBitmapImage()) {
85
        ImageOrientation orientation = DefaultImageOrientation;
85
        ImageOrientation frameOrientation(orientation);
86
        BitmapImage* bitmapImage = static_cast<BitmapImage *>(image);
86
        BitmapImage* bitmapImage = static_cast<BitmapImage *>(image);
87
        IntSize sizeRespectingOrientation = bitmapImage->sizeRespectingOrientation();
87
        IntSize sizeRespectingOrientation = bitmapImage->sizeRespectingOrientation(orientation, shouldRespectImageOrientation);
88
88
89
        if (shouldRespectImageOrientation == RespectImageOrientation)
89
        if (orientation == OriginTopLeft && shouldRespectImageOrientation == RespectImageOrientation)
90
            orientation = bitmapImage->currentFrameOrientation();
90
            frameOrientation = bitmapImage->currentFrameOrientation();
91
91
92
        if (orientation != DefaultImageOrientation) {
92
        if (frameOrientation != DefaultImageOrientation) {
93
            // Construct a correctly-rotated copy of the image to use as the drag image.
93
            // Construct a correctly-rotated copy of the image to use as the drag image.
94
            FloatRect destRect(FloatPoint(), sizeRespectingOrientation);
94
            FloatRect destRect(FloatPoint(), sizeRespectingOrientation);
95
95
Lines 99-107 RetainPtr<NSImage> createDragImageFromImage(Image* image, RespectImageOrientatio a/Source/WebCore/platform/mac/DragImageMac.mm_sec2
99
            // ImageOrientation uses top-left coordinates, need to flip to bottom-left, apply...
99
            // ImageOrientation uses top-left coordinates, need to flip to bottom-left, apply...
100
            CGAffineTransform transform = CGAffineTransformMakeTranslation(0, destRect.height());
100
            CGAffineTransform transform = CGAffineTransformMakeTranslation(0, destRect.height());
101
            transform = CGAffineTransformScale(transform, 1, -1);
101
            transform = CGAffineTransformScale(transform, 1, -1);
102
            transform = CGAffineTransformConcat(orientation.transformFromDefault(sizeRespectingOrientation), transform);
102
            transform = CGAffineTransformConcat(frameOrientation.transformFromDefault(sizeRespectingOrientation), transform);
103
103
104
            if (orientation.usesWidthAsHeight())
104
            if (frameOrientation.usesWidthAsHeight())
105
                destRect = FloatRect(destRect.x(), destRect.y(), destRect.height(), destRect.width());
105
                destRect = FloatRect(destRect.x(), destRect.y(), destRect.height(), destRect.width());
106
106
107
            // ...and flip back.
107
            // ...and flip back.
- a/Source/WebCore/platform/qt/DragImageQt.cpp -1 / +1 lines
Lines 60-66 DragImageRef dissolveDragImageToFraction(DragImageRef image, float) a/Source/WebCore/platform/qt/DragImageQt.cpp_sec1
60
    return image;
60
    return image;
61
}
61
}
62
62
63
DragImageRef createDragImageFromImage(Image* image, RespectImageOrientationEnum)
63
DragImageRef createDragImageFromImage(Image* image, ImageOrientationEnum, RespectImageOrientationEnum)
64
{
64
{
65
    if (!image || !image->nativeImageForCurrentFrame())
65
    if (!image || !image->nativeImageForCurrentFrame())
66
        return 0;
66
        return 0;
- a/Source/WebCore/platform/win/DragImageCGWin.cpp -1 / +1 lines
Lines 120-126 exit: a/Source/WebCore/platform/win/DragImageCGWin.cpp_sec1
120
    return hbmp;
120
    return hbmp;
121
}
121
}
122
    
122
    
123
DragImageRef createDragImageFromImage(Image* img, RespectImageOrientationEnum)
123
DragImageRef createDragImageFromImage(Image* img, ImageOrientationEnum, RespectImageOrientationEnum)
124
{
124
{
125
    HBITMAP hbmp = 0;
125
    HBITMAP hbmp = 0;
126
    HWndDC dc(0);
126
    HWndDC dc(0);
- a/Source/WebCore/platform/win/DragImageCairoWin.cpp -1 / +1 lines
Lines 150-156 exit: a/Source/WebCore/platform/win/DragImageCairoWin.cpp_sec1
150
    return hbmp;
150
    return hbmp;
151
}
151
}
152
    
152
    
153
DragImageRef createDragImageFromImage(Image* img, RespectImageOrientationEnum)
153
DragImageRef createDragImageFromImage(Image* img, ImageOrientationEnum, RespectImageOrientationEnum)
154
{
154
{
155
    HBITMAP hbmp = 0;
155
    HBITMAP hbmp = 0;
156
    HDC dc = GetDC(0);
156
    HDC dc = GetDC(0);
- a/Source/WebCore/rendering/RenderEmbeddedObject.cpp -1 / +1 lines
Lines 170-176 void RenderEmbeddedObject::paintSnapshotImage(PaintInfo& paintInfo, const Layout a/Source/WebCore/rendering/RenderEmbeddedObject.cpp_sec1
170
        return;
170
        return;
171
171
172
    bool useLowQualityScaling = shouldPaintAtLowQuality(context, image, image, alignedRect.size());
172
    bool useLowQualityScaling = shouldPaintAtLowQuality(context, image, image, alignedRect.size());
173
    context->drawImage(image, style()->colorSpace(), alignedRect, CompositeSourceOver, shouldRespectImageOrientation(), useLowQualityScaling);
173
    context->drawImage(image, style()->colorSpace(), alignedRect, CompositeSourceOver, DefaultImageOrientation, shouldRespectImageOrientation(), useLowQualityScaling);
174
}
174
}
175
175
176
void RenderEmbeddedObject::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
176
void RenderEmbeddedObject::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
- a/Source/WebCore/rendering/RenderImage.cpp -2 / +15 lines
Lines 146-151 void RenderImage::styleDidChange(StyleDifference diff, const RenderStyle* oldSty a/Source/WebCore/rendering/RenderImage.cpp_sec1
146
            imageDimensionsChanged(true /* imageSizeChanged */);
146
            imageDimensionsChanged(true /* imageSizeChanged */);
147
        m_needsToSetSizeForAltText = false;
147
        m_needsToSetSizeForAltText = false;
148
    }
148
    }
149
#if ENABLE(CSS_IMAGE_ORIENTATION)
150
    if (diff == StyleDifferenceLayout
151
        && oldStyle->imageOrientation() != style()->imageOrientation())
152
        return imageDimensionsChanged(true /* imageSizeChanged */);
153
#endif
149
#if ENABLE(CSS_IMAGE_RESOLUTION)
154
#if ENABLE(CSS_IMAGE_RESOLUTION)
150
    if (diff == StyleDifferenceLayout
155
    if (diff == StyleDifferenceLayout
151
        && (oldStyle->imageResolution() != style()->imageResolution()
156
        && (oldStyle->imageResolution() != style()->imageResolution()
Lines 353-359 void RenderImage::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOf a/Source/WebCore/rendering/RenderImage.cpp_sec2
353
                if (centerY < 0)
358
                if (centerY < 0)
354
                    centerY = 0;
359
                    centerY = 0;
355
                imageOffset = LayoutSize(leftBorder + leftPad + centerX + borderWidth, topBorder + topPad + centerY + borderWidth);
360
                imageOffset = LayoutSize(leftBorder + leftPad + centerX + borderWidth, topBorder + topPad + centerY + borderWidth);
356
                context->drawImage(image.get(), style()->colorSpace(), pixelSnappedIntRect(LayoutRect(paintOffset + imageOffset, imageSize)), CompositeSourceOver, shouldRespectImageOrientation());
361
                ImageOrientationEnum orientation = DefaultImageOrientation;
362
#if ENABLE(CSS_IMAGE_ORIENTATION)
363
                orientation = style()->imageOrientation();
364
#endif
365
                context->drawImage(image.get(), style()->colorSpace(), pixelSnappedIntRect(LayoutRect(paintOffset + imageOffset, imageSize)), CompositeSourceOver, orientation, shouldRespectImageOrientation());
357
                errorPictureDrawn = true;
366
                errorPictureDrawn = true;
358
            }
367
            }
359
368
Lines 475-481 void RenderImage::paintIntoRect(GraphicsContext* context, const LayoutRect& rect a/Source/WebCore/rendering/RenderImage.cpp_sec3
475
    CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator() : CompositeSourceOver;
484
    CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator() : CompositeSourceOver;
476
    Image* image = m_imageResource->image().get();
485
    Image* image = m_imageResource->image().get();
477
    bool useLowQualityScaling = shouldPaintAtLowQuality(context, image, image, alignedRect.size());
486
    bool useLowQualityScaling = shouldPaintAtLowQuality(context, image, image, alignedRect.size());
478
    context->drawImage(m_imageResource->image(alignedRect.width(), alignedRect.height()).get(), style()->colorSpace(), alignedRect, compositeOperator, shouldRespectImageOrientation(), useLowQualityScaling);
487
    ImageOrientationEnum orientation = DefaultImageOrientation;
488
#if ENABLE(CSS_IMAGE_ORIENTATION)
489
    orientation = style()->imageOrientation();
490
#endif
491
    context->drawImage(m_imageResource->image(alignedRect.width(), alignedRect.height()).get(), style()->colorSpace(), alignedRect, compositeOperator, orientation, shouldRespectImageOrientation(), useLowQualityScaling);
479
}
492
}
480
493
481
bool RenderImage::boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance bleedAvoidance, InlineFlowBox*) const
494
bool RenderImage::boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance bleedAvoidance, InlineFlowBox*) const
- a/Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp -1 / +5 lines
Lines 139-145 void RenderSnapshottedPlugIn::paintSnapshot(PaintInfo& paintInfo, const LayoutPo a/Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp_sec1
139
        return;
139
        return;
140
140
141
    bool useLowQualityScaling = shouldPaintAtLowQuality(context, image, image, alignedRect.size());
141
    bool useLowQualityScaling = shouldPaintAtLowQuality(context, image, image, alignedRect.size());
142
    context->drawImage(image, style()->colorSpace(), alignedRect, CompositeSourceOver, shouldRespectImageOrientation(), useLowQualityScaling);
142
    ImageOrientationEnum orientation = DefaultImageOrientation;
143
#if ENABLE(CSS_IMAGE_ORIENTATION)
144
    orientation = style()->imageOrientation();
145
#endif
146
    context->drawImage(image, style()->colorSpace(), alignedRect, CompositeSourceOver, orientation, shouldRespectImageOrientation(), useLowQualityScaling);
143
}
147
}
144
148
145
CursorDirective RenderSnapshottedPlugIn::getCursor(const LayoutPoint& point, Cursor& overrideCursor) const
149
CursorDirective RenderSnapshottedPlugIn::getCursor(const LayoutPoint& point, Cursor& overrideCursor) const
- a/Source/WebCore/rendering/style/RenderStyle.cpp +3 lines
Lines 493-498 bool RenderStyle::changeRequiresLayout(const RenderStyle* other, unsigned& chang a/Source/WebCore/rendering/style/RenderStyle.cpp_sec1
493
            || rareInheritedData->m_tabSize != other->rareInheritedData->m_tabSize
493
            || rareInheritedData->m_tabSize != other->rareInheritedData->m_tabSize
494
            || rareInheritedData->m_lineBoxContain != other->rareInheritedData->m_lineBoxContain
494
            || rareInheritedData->m_lineBoxContain != other->rareInheritedData->m_lineBoxContain
495
            || rareInheritedData->m_lineGrid != other->rareInheritedData->m_lineGrid
495
            || rareInheritedData->m_lineGrid != other->rareInheritedData->m_lineGrid
496
#if ENABLE(CSS_IMAGE_ORIENTATION)
497
            || rareInheritedData->m_imageOrientation != other->rareInheritedData->m_imageOrientation
498
#endif
496
#if ENABLE(CSS_IMAGE_RESOLUTION)
499
#if ENABLE(CSS_IMAGE_RESOLUTION)
497
            || rareInheritedData->m_imageResolutionSource != other->rareInheritedData->m_imageResolutionSource
500
            || rareInheritedData->m_imageResolutionSource != other->rareInheritedData->m_imageResolutionSource
498
            || rareInheritedData->m_imageResolutionSnap != other->rareInheritedData->m_imageResolutionSnap
501
            || rareInheritedData->m_imageResolutionSnap != other->rareInheritedData->m_imageResolutionSnap
- a/Source/WebCore/svg/graphics/SVGImage.cpp -1 / +1 lines
Lines 191-197 void SVGImage::drawPatternForContainer(GraphicsContext* context, const FloatSize a/Source/WebCore/svg/graphics/SVGImage.cpp_sec1
191
    image->drawPattern(context, scaledSrcRect, unscaledPatternTransform, phase, colorSpace, compositeOp, dstRect);
191
    image->drawPattern(context, scaledSrcRect, unscaledPatternTransform, phase, colorSpace, compositeOp, dstRect);
192
}
192
}
193
193
194
void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode)
194
void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationEnum)
195
{
195
{
196
    if (!m_page)
196
    if (!m_page)
197
        return;
197
        return;
- a/Source/WebCore/svg/graphics/SVGImage.h -1 / +1 lines
Lines 88-94 private: a/Source/WebCore/svg/graphics/SVGImage.h_sec1
88
    virtual bool currentFrameKnownToBeOpaque() OVERRIDE { return false; }
88
    virtual bool currentFrameKnownToBeOpaque() OVERRIDE { return false; }
89
89
90
    SVGImage(ImageObserver*);
90
    SVGImage(ImageObserver*);
91
    virtual void draw(GraphicsContext*, const FloatRect& fromRect, const FloatRect& toRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode);
91
    virtual void draw(GraphicsContext*, const FloatRect& fromRect, const FloatRect& toRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationEnum = DefaultImageOrientation);
92
    void drawForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const FloatRect&, ColorSpace, CompositeOperator, BlendMode);
92
    void drawForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const FloatRect&, ColorSpace, CompositeOperator, BlendMode);
93
    void drawPatternForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const AffineTransform&, const FloatPoint&, ColorSpace,
93
    void drawPatternForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const AffineTransform&, const FloatPoint&, ColorSpace,
94
        CompositeOperator, const FloatRect&);
94
        CompositeOperator, const FloatRect&);
- a/Source/WebCore/svg/graphics/SVGImageForContainer.cpp -1 / +1 lines
Lines 37-43 IntSize SVGImageForContainer::size() const a/Source/WebCore/svg/graphics/SVGImageForContainer.cpp_sec1
37
}
37
}
38
38
39
void SVGImageForContainer::draw(GraphicsContext* context, const FloatRect& dstRect,
39
void SVGImageForContainer::draw(GraphicsContext* context, const FloatRect& dstRect,
40
    const FloatRect& srcRect, ColorSpace colorSpace, CompositeOperator compositeOp, BlendMode blendMode)
40
    const FloatRect& srcRect, ColorSpace colorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationEnum)
41
{
41
{
42
    m_image->drawForContainer(context, m_containerSize, m_zoom, dstRect, srcRect, colorSpace, compositeOp, blendMode);
42
    m_image->drawForContainer(context, m_containerSize, m_zoom, dstRect, srcRect, colorSpace, compositeOp, blendMode);
43
}
43
}
- a/Source/WebCore/svg/graphics/SVGImageForContainer.h -1 / +1 lines
Lines 55-61 public: a/Source/WebCore/svg/graphics/SVGImageForContainer.h_sec1
55
        m_image->computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, intrinsicRatio);
55
        m_image->computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, intrinsicRatio);
56
    }
56
    }
57
57
58
    virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&, ColorSpace, CompositeOperator, BlendMode) OVERRIDE;
58
    virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&, ColorSpace, CompositeOperator, BlendMode, ImageOrientationEnum = DefaultImageOrientation) OVERRIDE;
59
59
60
    virtual void drawPattern(GraphicsContext*, const FloatRect&, const AffineTransform&, const FloatPoint&, ColorSpace, CompositeOperator, const FloatRect&, BlendMode) OVERRIDE;
60
    virtual void drawPattern(GraphicsContext*, const FloatRect&, const AffineTransform&, const FloatPoint&, ColorSpace, CompositeOperator, const FloatRect&, BlendMode) OVERRIDE;
61
61
- a/Tools/Scripts/webkitperl/FeatureList.pm -1 / +1 lines
Lines 207-213 my @features = ( a/Tools/Scripts/webkitperl/FeatureList.pm_sec1
207
      define => "ENABLE_CSS_BOX_DECORATION_BREAK", default => 1, value => \$cssBoxDecorationBreakSupport },
207
      define => "ENABLE_CSS_BOX_DECORATION_BREAK", default => 1, value => \$cssBoxDecorationBreakSupport },
208
208
209
    { option => "css-image-orientation", desc => "Toggle CSS image-orientation support",
209
    { option => "css-image-orientation", desc => "Toggle CSS image-orientation support",
210
      define => "ENABLE_CSS_IMAGE_ORIENTATION", default => isGtk(), value => \$cssImageOrientationSupport },
210
      define => "ENABLE_CSS_IMAGE_ORIENTATION", default => (isEfl() || isGtk()), value => \$cssImageOrientationSupport },
211
211
212
    { option => "css-image-resolution", desc => "Toggle CSS image-resolution support",
212
    { option => "css-image-resolution", desc => "Toggle CSS image-resolution support",
213
      define => "ENABLE_CSS_IMAGE_RESOLUTION", default => (isBlackBerry() || isGtk()), value => \$cssImageResolutionSupport },
213
      define => "ENABLE_CSS_IMAGE_RESOLUTION", default => (isBlackBerry() || isGtk()), value => \$cssImageResolutionSupport },
- a/LayoutTests/fast/css/image-orientation/image-orientation-expected.txt -17 / +17 lines
Lines 3-41 Apply image-resolution property and check computed style. a/LayoutTests/fast/css/image-orientation/image-orientation-expected.txt_sec1
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
4
5
5
6
PASS p.style.cssText is "image-orientation: -360deg; "
6
PASS p.style.cssText is "image-orientation: -360deg;"
7
PASS getComputedStyle(p).imageOrientation is "0deg"
7
PASS getComputedStyle(p).imageOrientation is "0deg"
8
PASS p.style.cssText is "image-orientation: -315deg; "
8
PASS p.style.cssText is "image-orientation: -315deg;"
9
PASS getComputedStyle(p).imageOrientation is "0deg"
9
PASS getComputedStyle(p).imageOrientation is "0deg"
10
PASS p.style.cssText is "image-orientation: 0deg; "
10
PASS p.style.cssText is "image-orientation: 0deg;"
11
PASS getComputedStyle(p).imageOrientation is "0deg"
11
PASS getComputedStyle(p).imageOrientation is "0deg"
12
PASS p.style.cssText is "image-orientation: 315deg; "
12
PASS p.style.cssText is "image-orientation: 315deg;"
13
PASS getComputedStyle(p).imageOrientation is "0deg"
13
PASS getComputedStyle(p).imageOrientation is "0deg"
14
PASS p.style.cssText is "image-orientation: 360deg; "
14
PASS p.style.cssText is "image-orientation: 360deg;"
15
PASS getComputedStyle(p).imageOrientation is "0deg"
15
PASS getComputedStyle(p).imageOrientation is "0deg"
16
PASS p.style.cssText is "image-orientation: -270deg; "
16
PASS p.style.cssText is "image-orientation: -270deg;"
17
PASS getComputedStyle(p).imageOrientation is "90deg"
17
PASS getComputedStyle(p).imageOrientation is "90deg"
18
PASS p.style.cssText is "image-orientation: -225deg; "
18
PASS p.style.cssText is "image-orientation: -225deg;"
19
PASS getComputedStyle(p).imageOrientation is "90deg"
19
PASS getComputedStyle(p).imageOrientation is "90deg"
20
PASS p.style.cssText is "image-orientation: 45deg; "
20
PASS p.style.cssText is "image-orientation: 45deg;"
21
PASS getComputedStyle(p).imageOrientation is "90deg"
21
PASS getComputedStyle(p).imageOrientation is "90deg"
22
PASS p.style.cssText is "image-orientation: 90deg; "
22
PASS p.style.cssText is "image-orientation: 90deg;"
23
PASS getComputedStyle(p).imageOrientation is "90deg"
23
PASS getComputedStyle(p).imageOrientation is "90deg"
24
PASS p.style.cssText is "image-orientation: -180deg; "
24
PASS p.style.cssText is "image-orientation: -180deg;"
25
PASS getComputedStyle(p).imageOrientation is "180deg"
25
PASS getComputedStyle(p).imageOrientation is "180deg"
26
PASS p.style.cssText is "image-orientation: -135deg; "
26
PASS p.style.cssText is "image-orientation: -135deg;"
27
PASS getComputedStyle(p).imageOrientation is "180deg"
27
PASS getComputedStyle(p).imageOrientation is "180deg"
28
PASS p.style.cssText is "image-orientation: 135deg; "
28
PASS p.style.cssText is "image-orientation: 135deg;"
29
PASS getComputedStyle(p).imageOrientation is "180deg"
29
PASS getComputedStyle(p).imageOrientation is "180deg"
30
PASS p.style.cssText is "image-orientation: -180deg; "
30
PASS p.style.cssText is "image-orientation: -180deg;"
31
PASS getComputedStyle(p).imageOrientation is "180deg"
31
PASS getComputedStyle(p).imageOrientation is "180deg"
32
PASS p.style.cssText is "image-orientation: -90deg; "
32
PASS p.style.cssText is "image-orientation: -90deg;"
33
PASS getComputedStyle(p).imageOrientation is "270deg"
33
PASS getComputedStyle(p).imageOrientation is "270deg"
34
PASS p.style.cssText is "image-orientation: -45deg; "
34
PASS p.style.cssText is "image-orientation: -45deg;"
35
PASS getComputedStyle(p).imageOrientation is "270deg"
35
PASS getComputedStyle(p).imageOrientation is "270deg"
36
PASS p.style.cssText is "image-orientation: 225deg; "
36
PASS p.style.cssText is "image-orientation: 225deg;"
37
PASS getComputedStyle(p).imageOrientation is "270deg"
37
PASS getComputedStyle(p).imageOrientation is "270deg"
38
PASS p.style.cssText is "image-orientation: 270deg; "
38
PASS p.style.cssText is "image-orientation: 270deg;"
39
PASS getComputedStyle(p).imageOrientation is "270deg"
39
PASS getComputedStyle(p).imageOrientation is "270deg"
40
PASS successfullyParsed is true
40
PASS successfullyParsed is true
41
41
- a/LayoutTests/fast/css/image-orientation/image-orientation.html -1 / +1 lines
Lines 20-26 for (expected in expectations) { a/LayoutTests/fast/css/image-orientation/image-orientation.html_sec1
20
    expectations[expected].forEach(function(test) {
20
    expectations[expected].forEach(function(test) {
21
        p.style.imageOrientation = '';
21
        p.style.imageOrientation = '';
22
        p.style.imageOrientation = test;
22
        p.style.imageOrientation = test;
23
        shouldBe('p.style.cssText', '"image-orientation: ' + test + '; "');
23
        shouldBe('p.style.cssText', '"image-orientation: ' + test + ';"');
24
        shouldBe('getComputedStyle(p).imageOrientation', '"' + expected + '"');
24
        shouldBe('getComputedStyle(p).imageOrientation', '"' + expected + '"');
25
    });
25
    });
26
}
26
}

Return to Bug 118454