Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[CSS] Enable css-image-orientation on EFL and GTK ports.
https://bugs.webkit.org/show_bug.cgi?id=123698

Reviewed by Beth Dakin.

Source/WebCore:

r157909 added wrong early return for css-image-orientation. It causes about 20 regressions in layout test
when enabling css-image-orientation. This fixes those wrong implementation as well as enables it on EFL
and GTK ports by default.

Test: fast/css/image-orientation/image-orientation.html

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::imageSizeForRenderer):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::updateSize):

Tools:

r157909 added wrong early return for css-image-orientation. It causes about 20 regressions in layout test
when enabling css-image-orientaiton. This fixes those wrong implementation as well as enables it on EFL
and GTK ports by default.

* Scripts/webkitperl/FeatureList.pm:


Canonical link: https://commits.webkit.org/141986@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158659 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Gyuyoung Kim committed Nov 5, 2013
1 parent fd58fda commit 2e75c46
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 19 deletions.
18 changes: 18 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,21 @@
2013-11-05 Gyuyoung Kim <gyuyoung.kim@samsung.com>

[CSS] Enable css-image-orientation on EFL and GTK ports.
https://bugs.webkit.org/show_bug.cgi?id=123698

Reviewed by Beth Dakin.

r157909 added wrong early return for css-image-orientation. It causes about 20 regressions in layout test
when enabling css-image-orientation. This fixes those wrong implementation as well as enables it on EFL
and GTK ports by default.

Test: fast/css/image-orientation/image-orientation.html

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::imageSizeForRenderer):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::updateSize):

2013-11-05 Andreas Kling <akling@apple.com>

RenderEmbeddedObject shouldn't know about fallback content.
Expand Down
18 changes: 6 additions & 12 deletions Source/WebCore/loader/cache/CachedImage.cpp
Expand Up @@ -257,18 +257,14 @@ LayoutSize CachedImage::imageSizeForRenderer(const RenderObject* renderer, float
if (!m_image)
return IntSize();

LayoutSize imageSize;
LayoutSize imageSize(m_image->size());

#if ENABLE(CSS_IMAGE_ORIENTATION)
if (!renderer)
return IntSize();

ImageOrientationDescription orientationDescription(renderer->shouldRespectImageOrientation());
orientationDescription.setImageOrientationEnum(renderer->style().imageOrientation());

if (m_image->isBitmapImage()
&& (orientationDescription.respectImageOrientation() == RespectImageOrientation && orientationDescription.imageOrientation() != DefaultImageOrientation))
imageSize = static_cast<BitmapImage*>(m_image.get())->sizeRespectingOrientation(orientationDescription);
if (renderer && m_image->isBitmapImage()) {
ImageOrientationDescription orientationDescription(renderer->shouldRespectImageOrientation(), renderer->style().imageOrientation());
if (orientationDescription.respectImageOrientation() == RespectImageOrientation)
imageSize = static_cast<BitmapImage*>(m_image.get())->sizeRespectingOrientation(orientationDescription);
}
#else
if (m_image->isBitmapImage() && (renderer && renderer->shouldRespectImageOrientation() == RespectImageOrientation))
imageSize = static_cast<BitmapImage*>(m_image.get())->sizeRespectingOrientation();
Expand All @@ -279,8 +275,6 @@ LayoutSize CachedImage::imageSizeForRenderer(const RenderObject* renderer, float
imageSize = m_svgImageCache->imageSizeForRenderer(renderer);
}
#endif
else
imageSize = m_image->size();

if (multiplier == 1.0f)
return imageSize;
Expand Down
7 changes: 1 addition & 6 deletions Source/WebCore/platform/graphics/BitmapImage.cpp
Expand Up @@ -182,12 +182,7 @@ void BitmapImage::didDecodeProperties() const

void BitmapImage::updateSize(ImageOrientationDescription description) const
{
if (!m_sizeAvailable || (m_haveSize
#if ENABLE(CSS_IMAGE_ORIENTATION)
&& description.imageOrientation() == static_cast<ImageOrientationEnum>(m_imageOrientation)
&& description.respectImageOrientation() == static_cast<RespectImageOrientationEnum>(m_shouldRespectImageOrientation)
#endif
))
if (!m_sizeAvailable || m_haveSize)
return;

m_size = m_source.size(description);
Expand Down
13 changes: 13 additions & 0 deletions Tools/ChangeLog
@@ -1,3 +1,16 @@
2013-11-05 Gyuyoung Kim <gyuyoung.kim@samsung.com>

[CSS] Enable css-image-orientation on EFL and GTK ports.
https://bugs.webkit.org/show_bug.cgi?id=123698

Reviewed by Beth Dakin.

r157909 added wrong early return for css-image-orientation. It causes about 20 regressions in layout test
when enabling css-image-orientaiton. This fixes those wrong implementation as well as enables it on EFL
and GTK ports by default.

* Scripts/webkitperl/FeatureList.pm:

2013-11-04 Alexey Proskuryakov <ap@apple.com>

DumpRenderTree should reset its preferences file on launch
Expand Down
2 changes: 1 addition & 1 deletion Tools/Scripts/webkitperl/FeatureList.pm
Expand Up @@ -211,7 +211,7 @@ my @features = (
define => "ENABLE_CSS_BOX_DECORATION_BREAK", default => 1, value => \$cssBoxDecorationBreakSupport },

{ option => "css-image-orientation", desc => "Toggle CSS image-orientation support",
define => "ENABLE_CSS_IMAGE_ORIENTATION", default => 0, value => \$cssImageOrientationSupport },
define => "ENABLE_CSS_IMAGE_ORIENTATION", default => (isEfl() || isGtk()), value => \$cssImageOrientationSupport },

{ option => "css-image-resolution", desc => "Toggle CSS image-resolution support",
define => "ENABLE_CSS_IMAGE_RESOLUTION", default => (isBlackBerry() || isGtk()), value => \$cssImageResolutionSupport },
Expand Down

0 comments on commit 2e75c46

Please sign in to comment.