Diff
Modified: trunk/LayoutTests/ChangeLog (219622 => 219623)
--- trunk/LayoutTests/ChangeLog 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/ChangeLog 2017-07-18 20:14:31 UTC (rev 219623)
@@ -1,5 +1,40 @@
2017-07-18 Sam Weinig <[email protected]>
+ [WebIDL] Remove custom bindings for MockContentFilterSettings
+ https://bugs.webkit.org/show_bug.cgi?id=174606
+
+ Reviewed by Andy Estes.
+
+ * contentfiltering/allow-after-add-data.html:
+ * contentfiltering/allow-after-finished-adding-data.html:
+ * contentfiltering/allow-after-response.html:
+ * contentfiltering/allow-after-will-send-request.html:
+ * contentfiltering/allow-empty-document.html:
+ * contentfiltering/allow-media-document.html:
+ * contentfiltering/allow-never.html:
+ * contentfiltering/block-after-add-data-then-allow-unblock.html:
+ * contentfiltering/block-after-add-data-then-deny-unblock.html:
+ * contentfiltering/block-after-add-data.html:
+ * contentfiltering/block-after-finished-adding-data-then-allow-unblock.html:
+ * contentfiltering/block-after-finished-adding-data-then-deny-unblock.html:
+ * contentfiltering/block-after-finished-adding-data.html:
+ * contentfiltering/block-after-response-then-allow-unblock.html:
+ * contentfiltering/block-after-response-then-deny-unblock.html:
+ * contentfiltering/block-after-response.html:
+ * contentfiltering/block-after-will-send-request-then-allow-unblock.html:
+ * contentfiltering/block-after-will-send-request-then-deny-unblock.html:
+ * contentfiltering/block-after-will-send-request.html:
+ * contentfiltering/block-never.html:
+ * contentfiltering/modify-request-url.html:
+ * contentfiltering/resources/contentfiltering.js:
+ * http/tests/contentfiltering/allow-after-redirect.html:
+ * http/tests/contentfiltering/block-after-redirect.html:
+ * http/tests/contentfiltering/load-substitute-data-from-appcache.html:
+ * http/tests/contentfiltering/modify-redirect-request-url.html:
+ Update tests to use new MockContentFilterSettings enums rather than constants.
+
+2017-07-18 Sam Weinig <[email protected]>
+
[WebIDL] Replace some custom bindings code in JSCSSStyleDeclarationCustom.cpp with named getters/setters
https://bugs.webkit.org/show_bug.cgi?id=174529
Modified: trunk/LayoutTests/contentfiltering/allow-after-add-data.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/allow-after-add-data.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/allow-after-add-data.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,6 +3,6 @@
<script>
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
- testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_ADD_DATA, /* decision */settings.DECISION_ALLOW);
+ testContentFiltering(/* decisionPoint */"afterAddData", /* decision */"allow");
}
</script>
Modified: trunk/LayoutTests/contentfiltering/allow-after-finished-adding-data.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/allow-after-finished-adding-data.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/allow-after-finished-adding-data.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,6 +3,6 @@
<script>
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
- testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_FINISHED_ADDING_DATA, /* decision */settings.DECISION_ALLOW);
+ testContentFiltering(/* decisionPoint */"afterFinishedAddingData", /* decision */"allow");
}
</script>
Modified: trunk/LayoutTests/contentfiltering/allow-after-response.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/allow-after-response.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/allow-after-response.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,6 +3,6 @@
<script>
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
- testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_RESPONSE, /* decision */settings.DECISION_ALLOW);
+ testContentFiltering(/* decisionPoint */"afterResponse", /* decision */"allow");
}
</script>
Modified: trunk/LayoutTests/contentfiltering/allow-after-will-send-request.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/allow-after-will-send-request.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/allow-after-will-send-request.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,6 +3,6 @@
<script>
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
- testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_WILL_SEND_REQUEST, /* decision */settings.DECISION_ALLOW);
+ testContentFiltering(/* decisionPoint */"afterWillSendRequest", /* decision */"allow");
}
</script>
Modified: trunk/LayoutTests/contentfiltering/allow-empty-document.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/allow-empty-document.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/allow-empty-document.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,8 +3,8 @@
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
settings.enabled = true;
- settings.decisionPoint = settings.DECISION_POINT_AFTER_FINISHED_ADDING_DATA;
- settings.decision = settings.DECISION_ALLOW;
+ settings.decisionPoint = "afterFinishedAddingData";
+ settings.decision = "allow";
}
</script>
<iframe src=""
Modified: trunk/LayoutTests/contentfiltering/allow-media-document.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/allow-media-document.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/allow-media-document.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,8 +3,8 @@
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
settings.enabled = true;
- settings.decisionPoint = settings.DECISION_POINT_AFTER_FINISHED_ADDING_DATA;
- settings.decision = settings.DECISION_ALLOW;
+ settings.decisionPoint = "afterFinishedAddingData";
+ settings.decision = "allow";
}
if (window.testRunner)
Modified: trunk/LayoutTests/contentfiltering/allow-never.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/allow-never.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/allow-never.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,6 +3,6 @@
<script>
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
- testContentFiltering(/* decisionPoint */settings.DECISION_POINT_NEVER, /* decision */settings.DECISION_ALLOW);
+ testContentFiltering(/* decisionPoint */"never", /* decision */"allow");
}
</script>
Modified: trunk/LayoutTests/contentfiltering/block-after-add-data-then-allow-unblock.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/block-after-add-data-then-allow-unblock.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/block-after-add-data-then-allow-unblock.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,6 +3,6 @@
<script>
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
- testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_ADD_DATA, /* decision */settings.DECISION_ALLOW, /* decideAfterUnblockRequest */true);
+ testContentFiltering(/* decisionPoint */"afterAddData", /* decision */"allow", /* decideAfterUnblockRequest */true);
}
</script>
Modified: trunk/LayoutTests/contentfiltering/block-after-add-data-then-deny-unblock.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/block-after-add-data-then-deny-unblock.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/block-after-add-data-then-deny-unblock.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,6 +3,6 @@
<script>
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
- testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_ADD_DATA, /* decision */settings.DECISION_BLOCK, /* decideAfterUnblockRequest */true);
+ testContentFiltering(/* decisionPoint */"afterAddData", /* decision */"block", /* decideAfterUnblockRequest */true);
}
</script>
Modified: trunk/LayoutTests/contentfiltering/block-after-add-data.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/block-after-add-data.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/block-after-add-data.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,6 +3,6 @@
<script>
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
- testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_ADD_DATA, /* decision */settings.DECISION_BLOCK);
+ testContentFiltering(/* decisionPoint */"afterAddData", /* decision */"block");
}
</script>
Modified: trunk/LayoutTests/contentfiltering/block-after-finished-adding-data-then-allow-unblock.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/block-after-finished-adding-data-then-allow-unblock.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/block-after-finished-adding-data-then-allow-unblock.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -4,6 +4,6 @@
var internals = window.internals;
if (internals) {
var settings = internals.mockContentFilterSettings;
- testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_FINISHED_ADDING_DATA, /* decision */settings.DECISION_ALLOW, /* decideAfterUnblockRequest */true);
+ testContentFiltering(/* decisionPoint */"afterFinishedAddingData", /* decision */"allow", /* decideAfterUnblockRequest */true);
}
</script>
Modified: trunk/LayoutTests/contentfiltering/block-after-finished-adding-data-then-deny-unblock.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/block-after-finished-adding-data-then-deny-unblock.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/block-after-finished-adding-data-then-deny-unblock.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -4,6 +4,6 @@
var internals = window.internals;
if (internals) {
var settings = internals.mockContentFilterSettings;
- testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_FINISHED_ADDING_DATA, /* decision */settings.DECISION_BLOCK, /* decideAfterUnblockRequest */true);
+ testContentFiltering(/* decisionPoint */"afterFinishedAddingData", /* decision */"block", /* decideAfterUnblockRequest */true);
}
</script>
Modified: trunk/LayoutTests/contentfiltering/block-after-finished-adding-data.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/block-after-finished-adding-data.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/block-after-finished-adding-data.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,6 +3,6 @@
<script>
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
- testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_FINISHED_ADDING_DATA, /* decision */settings.DECISION_BLOCK);
+ testContentFiltering(/* decisionPoint */"afterFinishedAddingData", /* decision */"block");
}
</script>
Modified: trunk/LayoutTests/contentfiltering/block-after-response-then-allow-unblock.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/block-after-response-then-allow-unblock.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/block-after-response-then-allow-unblock.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,6 +3,6 @@
<script>
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
- testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_RESPONSE, /* decision */settings.DECISION_ALLOW, /* decideAfterUnblockRequest */true);
+ testContentFiltering(/* decisionPoint */"afterResponse", /* decision */"allow", /* decideAfterUnblockRequest */true);
}
</script>
Modified: trunk/LayoutTests/contentfiltering/block-after-response-then-deny-unblock.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/block-after-response-then-deny-unblock.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/block-after-response-then-deny-unblock.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,6 +3,6 @@
<script>
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
- testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_RESPONSE, /* decision */settings.DECISION_BLOCK, /* decideAfterUnblockRequest */true);
+ testContentFiltering(/* decisionPoint */"afterResponse", /* decision */"block", /* decideAfterUnblockRequest */true);
}
</script>
Modified: trunk/LayoutTests/contentfiltering/block-after-response.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/block-after-response.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/block-after-response.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,6 +3,6 @@
<script>
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
- testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_RESPONSE, /* decision */settings.DECISION_BLOCK);
+ testContentFiltering(/* decisionPoint */"afterResponse", /* decision */"block");
}
</script>
Modified: trunk/LayoutTests/contentfiltering/block-after-will-send-request-then-allow-unblock.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/block-after-will-send-request-then-allow-unblock.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/block-after-will-send-request-then-allow-unblock.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,6 +3,6 @@
<script>
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
- testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_WILL_SEND_REQUEST, /* decision */settings.DECISION_ALLOW, /* decideAfterUnblockRequest */true);
+ testContentFiltering(/* decisionPoint */"afterWillSendRequest", /* decision */"allow", /* decideAfterUnblockRequest */true);
}
</script>
Modified: trunk/LayoutTests/contentfiltering/block-after-will-send-request-then-deny-unblock.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/block-after-will-send-request-then-deny-unblock.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/block-after-will-send-request-then-deny-unblock.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,6 +3,6 @@
<script>
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
- testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_WILL_SEND_REQUEST, /* decision */settings.DECISION_BLOCK, /* decideAfterUnblockRequest */true);
+ testContentFiltering(/* decisionPoint */"afterWillSendRequest", /* decision */"block", /* decideAfterUnblockRequest */true);
}
</script>
Modified: trunk/LayoutTests/contentfiltering/block-after-will-send-request.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/block-after-will-send-request.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/block-after-will-send-request.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,6 +3,6 @@
<script>
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
- testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_WILL_SEND_REQUEST, /* decision */settings.DECISION_BLOCK);
+ testContentFiltering(/* decisionPoint */"afterWillSendRequest", /* decision */"block");
}
</script>
Modified: trunk/LayoutTests/contentfiltering/block-never.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/block-never.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/block-never.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,6 +3,6 @@
<script>
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
- testContentFiltering(/* decisionPoint */settings.DECISION_POINT_NEVER, /* decision */settings.DECISION_BLOCK);
+ testContentFiltering(/* decisionPoint */"never", /* decision */"block");
}
</script>
Modified: trunk/LayoutTests/contentfiltering/modify-request-url.html (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/modify-request-url.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/modify-request-url.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,8 +3,8 @@
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
settings.enabled = true;
- settings.decisionPoint = settings.DECISION_POINT_AFTER_WILL_SEND_REQUEST;
- settings.decision = settings.DECISION_ALLOW;
+ settings.decisionPoint = "afterWillSendRequest";
+ settings.decision = "allow";
settings.modifiedRequestURL = "pass.html";
}
</script>
Modified: trunk/LayoutTests/contentfiltering/resources/contentfiltering.js (219622 => 219623)
--- trunk/LayoutTests/contentfiltering/resources/contentfiltering.js 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/contentfiltering/resources/contentfiltering.js 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,10 +3,10 @@
var settings = window.internals.mockContentFilterSettings;
settings.enabled = true;
settings.decisionPoint = decisionPoint;
- settings.decision = (decideAfterUnblockRequest ? settings.DECISION_BLOCK : decision);
+ settings.decision = (decideAfterUnblockRequest ? "block" : decision);
var blockedStringText;
- if (decisionPoint === settings.DECISION_POINT_NEVER || decision === settings.DECISION_ALLOW)
+ if (decisionPoint === "never" || decision === "allow")
blockedStringText = "FAIL";
else
blockedStringText = "PASS";
Modified: trunk/LayoutTests/http/tests/contentfiltering/allow-after-redirect.html (219622 => 219623)
--- trunk/LayoutTests/http/tests/contentfiltering/allow-after-redirect.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/http/tests/contentfiltering/allow-after-redirect.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,8 +3,8 @@
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
settings.enabled = true;
- settings.decisionPoint = settings.DECISION_POINT_AFTER_REDIRECT;
- settings.decision = settings.DECISION_ALLOW;
+ settings.decisionPoint = "afterRedirect";
+ settings.decision = "allow";
settings.blockedString = "<!DOCTYPE html><body>FAIL";
}
</script>
Modified: trunk/LayoutTests/http/tests/contentfiltering/block-after-redirect.html (219622 => 219623)
--- trunk/LayoutTests/http/tests/contentfiltering/block-after-redirect.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/http/tests/contentfiltering/block-after-redirect.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -4,8 +4,8 @@
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
settings.enabled = true;
- settings.decisionPoint = settings.DECISION_POINT_AFTER_REDIRECT;
- settings.decision = settings.DECISION_BLOCK;
+ settings.decisionPoint = "afterRedirect";
+ settings.decision = "block";
settings.blockedString = "<!DOCTYPE html><body>PASS";
}
Modified: trunk/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache.html (219622 => 219623)
--- trunk/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,8 +3,8 @@
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
settings.enabled = true;
- settings.decisionPoint = settings.DECISION_POINT_AFTER_ADD_DATA;
- settings.decision = settings.DECISION_ALLOW;
+ settings.decisionPoint = "afterAddData";
+ settings.decision = "allow";
}
if (window.testRunner) {
Modified: trunk/LayoutTests/http/tests/contentfiltering/modify-redirect-request-url.html (219622 => 219623)
--- trunk/LayoutTests/http/tests/contentfiltering/modify-redirect-request-url.html 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/LayoutTests/http/tests/contentfiltering/modify-redirect-request-url.html 2017-07-18 20:14:31 UTC (rev 219623)
@@ -3,8 +3,8 @@
if (window.internals) {
var settings = window.internals.mockContentFilterSettings;
settings.enabled = true;
- settings.decisionPoint = settings.DECISION_POINT_AFTER_REDIRECT;
- settings.decision = settings.DECISION_ALLOW;
+ settings.decisionPoint = "afterRedirect";
+ settings.decision = "allow";
settings.modifiedRequestURL = "pass.html";
}
</script>
Modified: trunk/Source/WebCore/ChangeLog (219622 => 219623)
--- trunk/Source/WebCore/ChangeLog 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/Source/WebCore/ChangeLog 2017-07-18 20:14:31 UTC (rev 219623)
@@ -1,5 +1,21 @@
2017-07-18 Sam Weinig <[email protected]>
+ [WebIDL] Remove custom bindings for MockContentFilterSettings
+ https://bugs.webkit.org/show_bug.cgi?id=174606
+
+ Reviewed by Andy Estes.
+
+ * PlatformMac.cmake:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSMockContentFilterSettingsCustom.cpp: Removed.
+ Remove JSMockContentFilterSettingsCustom.
+
+ * testing/MockContentFilterSettings.h:
+ * testing/MockContentFilterSettings.idl:
+ Switch from constants to IDL enums to make the bindings and tests simpler.
+
+2017-07-18 Sam Weinig <[email protected]>
+
[WebIDL] Replace some custom bindings code in JSCSSStyleDeclarationCustom.cpp with named getters/setters
https://bugs.webkit.org/show_bug.cgi?id=174529
Modified: trunk/Source/WebCore/PlatformMac.cmake (219622 => 219623)
--- trunk/Source/WebCore/PlatformMac.cmake 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/Source/WebCore/PlatformMac.cmake 2017-07-18 20:14:31 UTC (rev 219623)
@@ -800,8 +800,6 @@
list(APPEND WebCoreTestSupport_LIBRARIES PRIVATE WebCore)
list(APPEND WebCoreTestSupport_SOURCES
- bindings/js/JSMockContentFilterSettingsCustom.cpp
-
testing/Internals.mm
testing/MockContentFilter.cpp
testing/MockContentFilterSettings.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (219622 => 219623)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-07-18 20:14:31 UTC (rev 219623)
@@ -4328,7 +4328,6 @@
A1E1154413015C3D0054AC8C /* DistantLightSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1E1154313015C3D0054AC8C /* DistantLightSource.cpp */; };
A1E1154613015C4E0054AC8C /* PointLightSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1E1154513015C4E0054AC8C /* PointLightSource.cpp */; };
A1E1154813015C5D0054AC8C /* SpotLightSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1E1154713015C5D0054AC8C /* SpotLightSource.cpp */; };
- A1E5B31F1AAD1DA4006EBEFB /* JSMockContentFilterSettingsCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1E5B31D1AAD1DA4006EBEFB /* JSMockContentFilterSettingsCustom.cpp */; };
A1ED778C1BE3294000DC1791 /* Device.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1ED778A1BE3293F00DC1791 /* Device.cpp */; };
A1ED778D1BE3294000DC1791 /* Device.h in Headers */ = {isa = PBXBuildFile; fileRef = A1ED778B1BE3294000DC1791 /* Device.h */; settings = {ATTRIBUTES = (Private, ); }; };
A1ED778F1BE4291800DC1791 /* UIKitSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1ED778E1BE4291800DC1791 /* UIKitSPI.h */; };
@@ -12584,7 +12583,6 @@
A1E1154313015C3D0054AC8C /* DistantLightSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DistantLightSource.cpp; sourceTree = "<group>"; };
A1E1154513015C4E0054AC8C /* PointLightSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PointLightSource.cpp; sourceTree = "<group>"; };
A1E1154713015C5D0054AC8C /* SpotLightSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpotLightSource.cpp; sourceTree = "<group>"; };
- A1E5B31D1AAD1DA4006EBEFB /* JSMockContentFilterSettingsCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMockContentFilterSettingsCustom.cpp; sourceTree = "<group>"; };
A1ED778A1BE3293F00DC1791 /* Device.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Device.cpp; sourceTree = "<group>"; };
A1ED778B1BE3294000DC1791 /* Device.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Device.h; sourceTree = "<group>"; };
A1ED778E1BE4291800DC1791 /* UIKitSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIKitSPI.h; sourceTree = "<group>"; };
@@ -23631,7 +23629,6 @@
7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */,
BCE1C43F0D9830F4003B02F2 /* JSLocationCustom.cpp */,
410B7E711045FAB000D8224F /* JSMessageEventCustom.cpp */,
- A1E5B31D1AAD1DA4006EBEFB /* JSMockContentFilterSettingsCustom.cpp */,
C6F0917E143A2BB900685849 /* JSMutationObserverCustom.cpp */,
A85F22081430377D007CC884 /* JSPopStateEventCustom.cpp */,
418C395D1C8F0AAB0051C8A3 /* JSReadableStreamSourceCustom.cpp */,
@@ -30591,7 +30588,6 @@
CD5393D3175E018600C07123 /* JSMemoryInfo.cpp in Sources */,
CDF4B7321E03D06000E235A2 /* JSMockCDMFactory.cpp in Sources */,
A19AEA221AAA808A00B52B25 /* JSMockContentFilterSettings.cpp in Sources */,
- A1E5B31F1AAD1DA4006EBEFB /* JSMockContentFilterSettingsCustom.cpp in Sources */,
2D4150DE1C1F868C000A3BA2 /* JSMockPageOverlay.cpp in Sources */,
EBF5121C1696496C0056BD25 /* JSTypeConversions.cpp in Sources */,
CDC26B40160A8CC60026757B /* LegacyMockCDM.cpp in Sources */,
Deleted: trunk/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp (219622 => 219623)
--- trunk/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp 2017-07-18 20:14:31 UTC (rev 219623)
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "JSMockContentFilterSettings.h"
-
-#if ENABLE(CONTENT_FILTERING)
-
-#include "JSDOMBinding.h"
-#include "JSDOMConvertNumbers.h"
-#include "MockContentFilterSettings.h"
-
-using namespace JSC;
-
-namespace WebCore {
-
-using Decision = MockContentFilterSettings::Decision;
-using DecisionPoint = MockContentFilterSettings::DecisionPoint;
-
-JSValue JSMockContentFilterSettings::decisionPoint(ExecState&) const
-{
- DecisionPoint decisionPoint = wrapped().decisionPoint();
- switch (decisionPoint) {
- case DecisionPoint::AfterWillSendRequest:
- case DecisionPoint::AfterRedirect:
- case DecisionPoint::AfterResponse:
- case DecisionPoint::AfterAddData:
- case DecisionPoint::AfterFinishedAddingData:
- case DecisionPoint::Never:
- return jsNumber(static_cast<uint8_t>(decisionPoint));
- }
-
- ASSERT_NOT_REACHED();
- return jsUndefined();
-}
-
-void JSMockContentFilterSettings::setDecisionPoint(ExecState& state, JSValue value)
-{
- VM& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- uint8_t nativeValue { convert<IDLEnforceRangeAdaptor<IDLOctet>>(state, value) };
- RETURN_IF_EXCEPTION(scope, void());
-
- DecisionPoint decisionPoint { static_cast<DecisionPoint>(nativeValue) };
- switch (decisionPoint) {
- case DecisionPoint::AfterWillSendRequest:
- case DecisionPoint::AfterRedirect:
- case DecisionPoint::AfterResponse:
- case DecisionPoint::AfterAddData:
- case DecisionPoint::AfterFinishedAddingData:
- case DecisionPoint::Never:
- wrapped().setDecisionPoint(decisionPoint);
- return;
- }
-
- throwTypeError(&state, scope, String::format("%u is not a valid decisionPoint value.", nativeValue));
-}
-
-static inline JSValue toJSValue(Decision decision)
-{
- switch (decision) {
- case Decision::Allow:
- case Decision::Block:
- return jsNumber(static_cast<uint8_t>(decision));
- }
-
- ASSERT_NOT_REACHED();
- return jsUndefined();
-}
-
-static inline Decision toDecision(ExecState& state, JSValue value)
-{
- VM& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- uint8_t nativeValue { convert<IDLEnforceRangeAdaptor<IDLOctet>>(state, value) };
- RETURN_IF_EXCEPTION(scope, Decision::Allow);
-
- Decision decision { static_cast<Decision>(nativeValue) };
- switch (decision) {
- case Decision::Allow:
- case Decision::Block:
- return decision;
- }
-
- throwTypeError(&state, scope, String::format("%u is not a valid decision value.", nativeValue));
- return Decision::Allow;
-}
-
-JSValue JSMockContentFilterSettings::decision(ExecState&) const
-{
- return toJSValue(wrapped().decision());
-}
-
-void JSMockContentFilterSettings::setDecision(ExecState& state, JSValue value)
-{
- VM& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- Decision decision { toDecision(state, value) };
- RETURN_IF_EXCEPTION(scope, void());
-
- wrapped().setDecision(decision);
-}
-
-JSValue JSMockContentFilterSettings::unblockRequestDecision(ExecState&) const
-{
- return toJSValue(wrapped().unblockRequestDecision());
-}
-
-void JSMockContentFilterSettings::setUnblockRequestDecision(ExecState& state, JSValue value)
-{
- VM& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- Decision unblockRequestDecision { toDecision(state, value) };
- RETURN_IF_EXCEPTION(scope, void());
-
- wrapped().setUnblockRequestDecision(unblockRequestDecision);
-}
-
-}; // namespace WebCore
-
-#endif // ENABLE(CONTENT_FILTERING)
Modified: trunk/Source/WebCore/testing/MockContentFilterSettings.h (219622 => 219623)
--- trunk/Source/WebCore/testing/MockContentFilterSettings.h 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/Source/WebCore/testing/MockContentFilterSettings.h 2017-07-18 20:14:31 UTC (rev 219623)
@@ -31,7 +31,6 @@
class MockContentFilterSettings {
friend class NeverDestroyed<MockContentFilterSettings>;
-
public:
enum class DecisionPoint {
AfterWillSendRequest,
Modified: trunk/Source/WebCore/testing/MockContentFilterSettings.idl (219622 => 219623)
--- trunk/Source/WebCore/testing/MockContentFilterSettings.idl 2017-07-18 20:12:15 UTC (rev 219622)
+++ trunk/Source/WebCore/testing/MockContentFilterSettings.idl 2017-07-18 20:14:31 UTC (rev 219623)
@@ -23,6 +23,20 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+enum DecisionPoint {
+ "afterWillSendRequest",
+ "afterRedirect",
+ "afterResponse",
+ "afterAddData",
+ "afterFinishedAddingData",
+ "never"
+};
+
+enum Decision {
+ "allow",
+ "block"
+};
+
[
Conditional=CONTENT_FILTERING,
NoInterfaceObject,
@@ -32,18 +46,10 @@
attribute DOMString blockedString;
attribute DOMString modifiedRequestURL;
- const octet DECISION_POINT_AFTER_WILL_SEND_REQUEST = 0;
- const octet DECISION_POINT_AFTER_REDIRECT = 1;
- const octet DECISION_POINT_AFTER_RESPONSE = 2;
- const octet DECISION_POINT_AFTER_ADD_DATA = 3;
- const octet DECISION_POINT_AFTER_FINISHED_ADDING_DATA = 4;
- const octet DECISION_POINT_NEVER = 5;
- [Custom] attribute octet decisionPoint;
+ attribute DecisionPoint decisionPoint;
- const octet DECISION_ALLOW = 0;
- const octet DECISION_BLOCK = 1;
- [Custom] attribute octet decision;
- [Custom] attribute octet unblockRequestDecision;
+ attribute Decision decision;
+ attribute Decision unblockRequestDecision;
readonly attribute DOMString unblockRequestURL;
};