https://bugs.webkit.org/show_bug.cgi?id=147803
<rdar://problem/
22200553>
Reviewed by Sam Weinig.
Source/WebCore:
Rename webkitImageSmoothingEnabled to imageSmoothingEnabled.
Updated existing tests, and made sure that the prefixed version is
identical to the standard version.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::imageSmoothingEnabled): Renamed from webkitImageSmoothingEnabled.
(WebCore::CanvasRenderingContext2D::setImageSmoothingEnabled): Renamed from setWebkitImageSmoothingEnabled.
(WebCore::CanvasRenderingContext2D::webkitImageSmoothingEnabled): Deleted.
(WebCore::CanvasRenderingContext2D::setWebkitImageSmoothingEnabled): Deleted.
* html/canvas/CanvasRenderingContext2D.h: Rename the methods.
* html/canvas/CanvasRenderingContext2D.idl: Add the non-prefixed form, and mark is as the
implementation of the prefixed form.
LayoutTests:
Use the standard version of imageSmoothingEnabled rather than
the prefixed version.
* fast/canvas/canvas-imageSmoothingEnabled-expected.txt:
* fast/canvas/canvas-imageSmoothingEnabled-patterns.html:
* fast/canvas/canvas-imageSmoothingEnabled-zero-size.html:
* fast/canvas/script-tests/canvas-imageSmoothingEnabled-repaint.js:
(draw):
* fast/canvas/script-tests/canvas-imageSmoothingEnabled.js: Add some tests
to make sure the prefixed version correctly maps to the standard version.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188194
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-08-08 Dean Jackson <dino@apple.com>
+
+ Remove the webkit prefix from CanvasRenderingContext2D imageSmoothingEnabled
+ https://bugs.webkit.org/show_bug.cgi?id=147803
+ <rdar://problem/22200553>
+
+ Reviewed by Sam Weinig.
+
+ Use the standard version of imageSmoothingEnabled rather than
+ the prefixed version.
+
+ * fast/canvas/canvas-imageSmoothingEnabled-expected.txt:
+ * fast/canvas/canvas-imageSmoothingEnabled-patterns.html:
+ * fast/canvas/canvas-imageSmoothingEnabled-zero-size.html:
+ * fast/canvas/script-tests/canvas-imageSmoothingEnabled-repaint.js:
+ (draw):
+ * fast/canvas/script-tests/canvas-imageSmoothingEnabled.js: Add some tests
+ to make sure the prefixed version correctly maps to the standard version.
+
2015-08-08 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r179871.
Test that the default value is true.
-PASS ctx.webkitImageSmoothingEnabled is true
+PASS ctx.imageSmoothingEnabled is true
Test that false is returned after a the attribute is set to false.
-PASS ctx.webkitImageSmoothingEnabled is false
+PASS ctx.imageSmoothingEnabled is false
Test that restore works. We save a false state; create, then save a true state; and then finally restore.
-PASS ctx.webkitImageSmoothingEnabled is false
+PASS ctx.imageSmoothingEnabled is false
New canvas element created.
Test that the image is smoothed by default. We check by making sure the pixel just to the left of the middle line is not completely black.
PASS left_of_center_pixel.data[0] !== 0 is true
PASS left_of_center_pixel.data[0] is 0
PASS left_of_center_pixel.data[1] is 0
PASS left_of_center_pixel.data[2] is 0
+Test that the prefixed attribute mirrors the unprefixed attribute.
+PASS ctx.imageSmoothingEnabled is false
+PASS ctx.webkitImageSmoothingEnabled is false
+PASS ctx.imageSmoothingEnabled is true
+PASS ctx.webkitImageSmoothingEnabled is true
+PASS ctx.imageSmoothingEnabled is false
+PASS ctx.webkitImageSmoothingEnabled is false
+PASS ctx.imageSmoothingEnabled is true
+PASS ctx.webkitImageSmoothingEnabled is true
PASS successfullyParsed is true
TEST COMPLETE
var ctx = canvas.getContext('2d');
var pattern = ctx.createPattern(image, "repeat");
ctx.fillStyle = pattern;
- ctx.webkitImageSmoothingEnabled = smoothing;
+ ctx.imageSmoothingEnabled = smoothing;
ctx.scale(10, 10);
ctx.fillRect(0, 0, canvas.width, canvas.height);
}
var ctx = canvas.getContext('2d');
var pattern = ctx.createPattern(image, "repeat");
ctx.fillStyle = pattern;
- ctx.webkitImageSmoothingEnabled = smoothing;
+ ctx.imageSmoothingEnabled = smoothing;
ctx.scale(10, 10);
ctx.beginPath();
ctx.moveTo(0,0);
var pattern = ctx.createPattern(image, "repeat");
ctx.strokeStyle = pattern;
ctx.lineWidth = 5;
- ctx.webkitImageSmoothingEnabled = smoothing;
+ ctx.imageSmoothingEnabled = smoothing;
ctx.scale(10, 10);
ctx.beginPath();
ctx.moveTo(0,0);
testRunner.dumpAsText();
}
window.onload = function () {
- var canvas = document.createElement('canvas');
- canvas.width = 0;
- canvas.height = 0;
- var context = canvas.getContext('2d');
- if(context.webkitImageSmoothingEnabled) {context.webkitImageSmoothingEnabled = false;}
+ var canvas = document.createElement('canvas');
+ canvas.width = 0;
+ canvas.height = 0;
+ var context = canvas.getContext('2d');
+ if(context.imageSmoothingEnabled) {context.imageSmoothingEnabled = false;}
};
</script>
</body>
srcCtx.fillRect(0, 0, 1, 1);
srcCtx.fillStyle = "rgb(0, 255, 0)";
srcCtx.fillRect(1, 0, 1, 1);
- dstCtx.webkitImageSmoothingEnabled = false;
+ dstCtx.imageSmoothingEnabled = false;
dstCtx.drawImage(srcCanvas, 0, 0, 2, 1, 0, 0, 300, 300);
}
var ctx = document.createElement('canvas').getContext('2d');
debug("Test that the default value is true.");
-shouldBe("ctx.webkitImageSmoothingEnabled", "true");
+shouldBe("ctx.imageSmoothingEnabled", "true");
debug("Test that false is returned after a the attribute is set to false.");
-ctx.webkitImageSmoothingEnabled = false;
-shouldBe("ctx.webkitImageSmoothingEnabled", "false");
+ctx.imageSmoothingEnabled = false;
+shouldBe("ctx.imageSmoothingEnabled", "false");
debug("Test that restore works. We save a false state; create, then save a true state; and then finally restore.");
ctx.save();
-ctx.webkitImageSmoothingEnabled = true;
+ctx.imageSmoothingEnabled = true;
ctx.restore();
-shouldBe("ctx.webkitImageSmoothingEnabled", "false");
+shouldBe("ctx.imageSmoothingEnabled", "false");
var image = document.createElement('canvas');
image.width = 2;
shouldBe("left_of_center_pixel.data[1] !== 0", "true");
shouldBe("left_of_center_pixel.data[2] !== 0", "true");
-ctx.webkitImageSmoothingEnabled = false;
+ctx.imageSmoothingEnabled = false;
ctx.drawImage(image, 0, 0, canvas.width, canvas.height);
left_of_center_pixel = ctx.getImageData(1, 0, 1, 1);
debug("Test that nearest neighbour is used when imageSmoothingEnabled is set to false. We check this by making sure the pixel just to the left of the middle line is completely black.");
shouldBe("left_of_center_pixel.data[1]", "0");
shouldBe("left_of_center_pixel.data[2]", "0");
-ctx.webkitImageSmoothingEnabled = true;
+ctx.imageSmoothingEnabled = true;
ctx.drawImage(image, 0, 0, canvas.width, canvas.height);
left_of_center_pixel = ctx.getImageData(1, 0, 1, 1);
debug("Test that the image is smoothed when imageSmoothingEnabled is set to true.");
shouldBe("left_of_center_pixel.data[2] !== 0", "true");
debug("Test that restoring actually changes smoothing and not just the attribute value. We are restoring to a point where imageSmoothingEnabled is set to false.");
-ctx.webkitImageSmoothingEnabled = false;
+ctx.imageSmoothingEnabled = false;
ctx.save();
-ctx.webkitImageSmoothingEnabled = true;
+ctx.imageSmoothingEnabled = true;
ctx.restore();
ctx.drawImage(image, 0, 0, canvas.width, canvas.height);
left_of_center_pixel = ctx.getImageData(1, 0, 1, 1);
shouldBe("left_of_center_pixel.data[1]", "0");
shouldBe("left_of_center_pixel.data[2]", "0");
+debug("Test that the prefixed attribute mirrors the unprefixed attribute.");
+ctx.imageSmoothingEnabled = false;
+shouldBe("ctx.imageSmoothingEnabled", "false");
+shouldBe("ctx.webkitImageSmoothingEnabled", "false");
+ctx.imageSmoothingEnabled = true;
+shouldBe("ctx.imageSmoothingEnabled", "true");
+shouldBe("ctx.webkitImageSmoothingEnabled", "true");
+ctx.webkitImageSmoothingEnabled = false;
+shouldBe("ctx.imageSmoothingEnabled", "false");
+shouldBe("ctx.webkitImageSmoothingEnabled", "false");
+ctx.webkitImageSmoothingEnabled = true;
+shouldBe("ctx.imageSmoothingEnabled", "true");
+shouldBe("ctx.webkitImageSmoothingEnabled", "true");
+2015-08-08 Dean Jackson <dino@apple.com>
+
+ Remove the webkit prefix from CanvasRenderingContext2D imageSmoothingEnabled
+ https://bugs.webkit.org/show_bug.cgi?id=147803
+ <rdar://problem/22200553>
+
+ Reviewed by Sam Weinig.
+
+ Rename webkitImageSmoothingEnabled to imageSmoothingEnabled.
+
+ Updated existing tests, and made sure that the prefixed version is
+ identical to the standard version.
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::imageSmoothingEnabled): Renamed from webkitImageSmoothingEnabled.
+ (WebCore::CanvasRenderingContext2D::setImageSmoothingEnabled): Renamed from setWebkitImageSmoothingEnabled.
+ (WebCore::CanvasRenderingContext2D::webkitImageSmoothingEnabled): Deleted.
+ (WebCore::CanvasRenderingContext2D::setWebkitImageSmoothingEnabled): Deleted.
+ * html/canvas/CanvasRenderingContext2D.h: Rename the methods.
+ * html/canvas/CanvasRenderingContext2D.idl: Add the non-prefixed form, and mark is as the
+ implementation of the prefixed form.
+
2015-08-09 Andreas Kling <akling@apple.com>
Ref-ify some functions that always succeed in constructing Documents.
}
#endif
-bool CanvasRenderingContext2D::webkitImageSmoothingEnabled() const
+bool CanvasRenderingContext2D::imageSmoothingEnabled() const
{
return state().m_imageSmoothingEnabled;
}
-void CanvasRenderingContext2D::setWebkitImageSmoothingEnabled(bool enabled)
+void CanvasRenderingContext2D::setImageSmoothingEnabled(bool enabled)
{
if (enabled == state().m_imageSmoothingEnabled)
return;
LineCap getLineCap() const { return state().m_lineCap; }
LineJoin getLineJoin() const { return state().m_lineJoin; }
- bool webkitImageSmoothingEnabled() const;
- void setWebkitImageSmoothingEnabled(bool);
+ bool imageSmoothingEnabled() const;
+ void setImageSmoothingEnabled(bool);
private:
enum class Direction {
readonly attribute float webkitBackingStorePixelRatio;
- attribute boolean webkitImageSmoothingEnabled;
+ attribute boolean imageSmoothingEnabled;
+ [ImplementedAs=imageSmoothingEnabled] attribute boolean webkitImageSmoothingEnabled;
};