diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index b05ca2d560e2..ee125437513c 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -3873,6 +3873,8 @@ static CursorImage ComputeCustomCursor(nsPresContext* aPresContext, if (!container) { continue; } + container = nsLayoutUtils::OrientImage( + container, aFrame.StyleVisibility()->mImageOrientation); Maybe specifiedHotspot = image.has_hotspot ? Some(gfx::Point{image.hotspot_x, image.hotspot_y}) : Nothing(); diff --git a/layout/generic/nsBulletFrame.cpp b/layout/generic/nsBulletFrame.cpp index 75aa277411ba..b1f4cd56b71e 100644 --- a/layout/generic/nsBulletFrame.cpp +++ b/layout/generic/nsBulletFrame.cpp @@ -667,6 +667,8 @@ Maybe nsBulletFrame::CreateBulletRenderer( nsCOMPtr imageCon; mImageRequest->GetImage(getter_AddRefs(imageCon)); if (imageCon) { + imageCon = nsLayoutUtils::OrientImage( + imageCon, StyleVisibility()->mImageOrientation); nsRect dest(padding.left, padding.top, mRect.width - (padding.left + padding.right), mRect.height - (padding.top + padding.bottom)); diff --git a/layout/painting/nsImageRenderer.cpp b/layout/painting/nsImageRenderer.cpp index 19b3781f6e10..45900f6ddf5a 100644 --- a/layout/painting/nsImageRenderer.cpp +++ b/layout/painting/nsImageRenderer.cpp @@ -134,6 +134,11 @@ bool nsImageRenderer::PrepareImage() { "If GetImage() is failing, mImage->IsComplete() " "should have returned false"); + if (srcImage) { + srcImage = nsLayoutUtils::OrientImage( + srcImage, mForFrame->StyleVisibility()->mImageOrientation); + } + if (!mImage->IsRect()) { mImageContainer.swap(srcImage); } else { diff --git a/testing/web-platform/meta/css/css-images/image-orientation/image-orientation-background-image.html.ini b/testing/web-platform/meta/css/css-images/image-orientation/image-orientation-background-image.html.ini index 897f3912bdda..477da859fbec 100644 --- a/testing/web-platform/meta/css/css-images/image-orientation/image-orientation-background-image.html.ini +++ b/testing/web-platform/meta/css/css-images/image-orientation/image-orientation-background-image.html.ini @@ -1,2 +1,2 @@ [image-orientation-background-image.html] - fuzzy: 2;40 + fuzzy: 3;49 diff --git a/testing/web-platform/meta/css/css-images/image-orientation/image-orientation-mask-image.html.ini b/testing/web-platform/meta/css/css-images/image-orientation/image-orientation-mask-image.html.ini index 20246281a511..d1364b6ffd2e 100644 --- a/testing/web-platform/meta/css/css-images/image-orientation/image-orientation-mask-image.html.ini +++ b/testing/web-platform/meta/css/css-images/image-orientation/image-orientation-mask-image.html.ini @@ -1,2 +1,2 @@ [image-orientation-mask-image.html] - fuzzy: 1;22 + fuzzy: 2;26 diff --git a/testing/web-platform/tests/css/css-images/image-orientation/image-orientation-background-image.html b/testing/web-platform/tests/css/css-images/image-orientation/image-orientation-background-image.html index 2687a5c64b51..d294b669e35d 100644 --- a/testing/web-platform/tests/css/css-images/image-orientation/image-orientation-background-image.html +++ b/testing/web-platform/tests/css/css-images/image-orientation/image-orientation-background-image.html @@ -1,6 +1,6 @@ -CSS Images Module Level 3: image-orientation does not apply to background-image +CSS Images Module Level 3: image-orientation does apply to background-image diff --git a/testing/web-platform/tests/css/css-images/image-orientation/image-orientation-border-image.html b/testing/web-platform/tests/css/css-images/image-orientation/image-orientation-border-image.html index 85b363ecc2fd..312c6736fb52 100644 --- a/testing/web-platform/tests/css/css-images/image-orientation/image-orientation-border-image.html +++ b/testing/web-platform/tests/css/css-images/image-orientation/image-orientation-border-image.html @@ -1,6 +1,6 @@ -CSS Images Module Level 3: image-orientation does not apply to border images +CSS Images Module Level 3: image-orientation does apply to border images diff --git a/testing/web-platform/tests/css/css-images/image-orientation/image-orientation-cursor.html b/testing/web-platform/tests/css/css-images/image-orientation/image-orientation-cursor.html new file mode 100644 index 000000000000..00a80d46ba9f --- /dev/null +++ b/testing/web-platform/tests/css/css-images/image-orientation/image-orientation-cursor.html @@ -0,0 +1,21 @@ + + +CSS Images Module Level 3: image-orientation does apply to cursor + + + + +

The test passes if

+
    +
  • when moved inside either of the blue boxes, the cursor is shown as a + black arrow on a white background, with the point of the arrow at the current + cursor location
  • +
  • in the first box, the cursor points up and to the right
  • +
  • in the second box, the cursor points down and to the right
  • +
+
+
diff --git a/testing/web-platform/tests/css/css-images/image-orientation/image-orientation-iframe.html b/testing/web-platform/tests/css/css-images/image-orientation/image-orientation-iframe.html new file mode 100644 index 000000000000..69cfb5ceae4f --- /dev/null +++ b/testing/web-platform/tests/css/css-images/image-orientation/image-orientation-iframe.html @@ -0,0 +1,11 @@ + + +CSS Images Module Level 3: image-orientation does not apply to iframe contents + + + + + + diff --git a/testing/web-platform/tests/css/css-images/image-orientation/image-orientation-list-style-image.html b/testing/web-platform/tests/css/css-images/image-orientation/image-orientation-list-style-image.html index 33730a323ada..926b3ab9ff02 100644 --- a/testing/web-platform/tests/css/css-images/image-orientation/image-orientation-list-style-image.html +++ b/testing/web-platform/tests/css/css-images/image-orientation/image-orientation-list-style-image.html @@ -1,6 +1,6 @@ -CSS Images Module Level 3: image-orientation does not apply to list-style-image +CSS Images Module Level 3: image-orientation does apply to list-style-image diff --git a/testing/web-platform/tests/css/css-images/image-orientation/reference/image-orientation-background-image-ref.html b/testing/web-platform/tests/css/css-images/image-orientation/reference/image-orientation-background-image-ref.html index e57090647984..a3e2ece6e7c2 100644 --- a/testing/web-platform/tests/css/css-images/image-orientation/reference/image-orientation-background-image-ref.html +++ b/testing/web-platform/tests/css/css-images/image-orientation/reference/image-orientation-background-image-ref.html @@ -2,8 +2,9 @@ CSS Reference -
-
- +
+
diff --git a/testing/web-platform/tests/css/css-images/image-orientation/reference/image-orientation-border-image-ref.html b/testing/web-platform/tests/css/css-images/image-orientation/reference/image-orientation-border-image-ref.html index 3f9b68832b12..51aa8d0e4672 100644 --- a/testing/web-platform/tests/css/css-images/image-orientation/reference/image-orientation-border-image-ref.html +++ b/testing/web-platform/tests/css/css-images/image-orientation/reference/image-orientation-border-image-ref.html @@ -6,8 +6,9 @@ div { width: 100px; height: 50px; border: 10px solid black; - border-image: url(../support/exif-orientation-2-ur-pre-rotated.jpg) 10; } +.orient { border-image: url(../support/exif-orientation-2-ur-pre-rotated.jpg) 10; } +.no-orient { border-image: url(../support/exif-orientation-9-u.jpg) 10; } -
-
+
+
diff --git a/testing/web-platform/tests/css/css-images/image-orientation/reference/image-orientation-iframe-ref.html b/testing/web-platform/tests/css/css-images/image-orientation/reference/image-orientation-iframe-ref.html new file mode 100644 index 000000000000..a9e9b3fbe308 --- /dev/null +++ b/testing/web-platform/tests/css/css-images/image-orientation/reference/image-orientation-iframe-ref.html @@ -0,0 +1,5 @@ + + +CSS Reference + + diff --git a/testing/web-platform/tests/css/css-images/image-orientation/reference/image-orientation-list-style-image-ref.html b/testing/web-platform/tests/css/css-images/image-orientation/reference/image-orientation-list-style-image-ref.html index 433cf98e636b..8dcef6a24392 100644 --- a/testing/web-platform/tests/css/css-images/image-orientation/reference/image-orientation-list-style-image-ref.html +++ b/testing/web-platform/tests/css/css-images/image-orientation/reference/image-orientation-list-style-image-ref.html @@ -2,7 +2,9 @@ CSS Reference -
  •  
-
  •  
+
  •  
+
  •  
diff --git a/testing/web-platform/tests/css/css-images/image-orientation/reference/image-orientation-mask-image-ref.html b/testing/web-platform/tests/css/css-images/image-orientation/reference/image-orientation-mask-image-ref.html index ff0782441512..ba593032456f 100644 --- a/testing/web-platform/tests/css/css-images/image-orientation/reference/image-orientation-mask-image-ref.html +++ b/testing/web-platform/tests/css/css-images/image-orientation/reference/image-orientation-mask-image-ref.html @@ -6,9 +6,10 @@ div { width: 100px; height: 50px; background: blue; - mask-image: url(../support/exif-orientation-2-ur-pre-rotated.jpg); mask-mode: luminance; } +.orient { mask-image: url(../support/exif-orientation-2-ur-pre-rotated.jpg); } +.no-orient { mask-image: url(../support/exif-orientation-9-u.jpg); } -
-
+
+
diff --git a/testing/web-platform/tests/css/css-images/image-orientation/support/cursor-8-llo.jpg b/testing/web-platform/tests/css/css-images/image-orientation/support/cursor-8-llo.jpg new file mode 100644 index 000000000000..ef26ad4aaaee Binary files /dev/null and b/testing/web-platform/tests/css/css-images/image-orientation/support/cursor-8-llo.jpg differ