Remove the webkitallowfullscreen content attribute
Intent to Deprecate and Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/LupOLlogL-g/H8GsBEDGQeMJ
Tests were updated to use allowfullscreen instead of
webkitallowfullscreen, with a few exceptions:
fullscreen/full-screen-enabled-prefixed.html would have become redundant
with fullscreen/full-screen-enabled.html and was removed.
fullscreen/full-screen-iframe-with-mixed-allow-webkitallow-attribute.html
became a test for nested iframes with allowfullscreen and was renamed.
Finally, doctypes were added and whitespace cleaned up in touched test.
fullscreen/resources/full-screen-iframe-allowed-nested2.html depended on
being in quirks mode, since the size of the body element is smaller in
standards mode. Put the click event handler on window instead.
BUG=390008
Review URL: https://codereview.chromium.org/336313015
git-svn-id: svn://svn.chromium.org/blink/trunk@177332 bbb929c8-8fbe-4397-9dbb-9b2b20218538
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations
index 6baaab5..16e4f12 100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -607,7 +607,6 @@
# Android virtual suite shares the same expectation.
crbug.com/100798 [ Debug ] virtual/android/fullscreen/full-screen-iframe-allowed.html [ Failure Pass ]
-crbug.com/100798 [ Debug ] virtual/android/fullscreen/full-screen-iframe-allowed-prefixed.html [ Failure Pass ]
crbug.com/243782 virtual/android/fullscreen/full-screen-remove-ancestor.html [ Pass Timeout ]
crbug.com/267888 [ Android ] crypto [ Skip ]
diff --git a/third_party/WebKit/LayoutTests/fullscreen/exit-full-screen-iframe.html b/third_party/WebKit/LayoutTests/fullscreen/exit-full-screen-iframe.html
index 80d66ca4..e753659 100644
--- a/third_party/WebKit/LayoutTests/fullscreen/exit-full-screen-iframe.html
+++ b/third_party/WebKit/LayoutTests/fullscreen/exit-full-screen-iframe.html
@@ -1,3 +1,4 @@
+<!DOCTYPE html>
<p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=90327">bug 90327</a>:
webkitCancelFullScreen for iframes</p>
<p>To test manually, click the "Go full screen" button - the page should enter full screen mode and immediately exit again, without crashing.</p>
@@ -21,5 +22,5 @@
});
}
</script>
-<iframe id="frame" src="resources/inner.html" width="300" height="100" onload="runTest()" webkitallowfullscreen>
+<iframe id="frame" src="resources/inner.html" width="300" height="100" onload="runTest()" allowfullscreen>
</iframe>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-enabled-prefixed-expected.txt b/third_party/WebKit/LayoutTests/fullscreen/full-screen-enabled-prefixed-expected.txt
deleted file mode 100644
index 012c0d2..0000000
--- a/third_party/WebKit/LayoutTests/fullscreen/full-screen-enabled-prefixed-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-This tests the fullscreenEnabled property laid out in section 4 of the W3C Full Screen API
-EXPECTED (iframe.contentDocument.webkitFullscreenEnabled == 'true') OK
-EXPECTED (iframe2.contentDocument.webkitFullscreenEnabled == 'false') OK
-END OF TEST
-
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-enabled-prefixed.html b/third_party/WebKit/LayoutTests/fullscreen/full-screen-enabled-prefixed.html
deleted file mode 100644
index 6d10be5..0000000
--- a/third_party/WebKit/LayoutTests/fullscreen/full-screen-enabled-prefixed.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<body>
-<div>This tests the <code>fullscreenEnabled</code> property laid out in section 4 of the W3C
-<a href="http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html">Full Screen API</a></div>
-<script src="full-screen-test.js"></script>
-<script>
- var iframe = document.documentElement.appendChild(document.createElement('iframe'));
- iframe.setAttribute('webkitallowfullscreen', 'true');
- var iframe2 = document.documentElement.appendChild(document.createElement('iframe'));
- testExpected('iframe.contentDocument.webkitFullscreenEnabled', true);
- testExpected('iframe2.contentDocument.webkitFullscreenEnabled', false);
- endTest();
-</script>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-allowed-nested-expected.txt b/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-allowed-nested-expected.txt
new file mode 100644
index 0000000..0462668
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-allowed-nested-expected.txt
@@ -0,0 +1,7 @@
+Test entering full screen for nested iframes.
+
+To test manually, click into inner frame, the page should enter full screen mode.
+
+SUCCEED - entered full screen!
+END OF TEST
+
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-with-mixed-allow-webkitallow-attribute.html b/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-allowed-nested.html
similarity index 73%
rename from third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-with-mixed-allow-webkitallow-attribute.html
rename to third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-allowed-nested.html
index ce7e69e7..e4256326 100644
--- a/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-with-mixed-allow-webkitallow-attribute.html
+++ b/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-allowed-nested.html
@@ -1,8 +1,8 @@
-<p>Test entering full screen for a nested iframe works with a mixture of both
-allowfullscreen and webkitallowfullscreen.</p>
+<!DOCTYPE html>
+<p>Test entering full screen for nested iframes.</p>
<p>To test manually, click into inner frame, the page should enter full screen mode.</p>
<script src="full-screen-test.js"></script>
-<iframe webkitallowfullscreen src="resources/full-screen-iframe-with-mixed-allow-webkitallow-iframe1.html">
+<iframe allowfullscreen src="resources/full-screen-iframe-allowed-nested1.html">
</iframe>
<script>
window.onmessage = function () { // iframes have been loaded and messaged us.
@@ -22,4 +22,3 @@
}
}
</script>
-
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-allowed-prefixed-expected.txt b/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-allowed-prefixed-expected.txt
deleted file mode 100644
index 2134b66a..0000000
--- a/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-allowed-prefixed-expected.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Test for bug 56264: Handle entering full screen security restrictions
-
-To test manually, click the "Go full screen" button - the page should enter full screen mode.
-
-EVENT(webkitfullscreenchange)
-TEST(document.getElementById('frame').contentDocument.width==document.width) OK
-END OF TEST
-
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-allowed-prefixed.html b/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-allowed-prefixed.html
deleted file mode 100644
index ebbdf41..0000000
--- a/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-allowed-prefixed.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=56264">bug 56264</a>:
-Handle entering full screen security restrictions</p>
-<p>To test manually, click the "Go full screen" button - the page should enter full screen mode.</p>
-<script src="full-screen-test.js"></script>
-<script>
-function runTest() {
- var frame = document.getElementById('frame');
-
- waitForEvent(frame.contentDocument, 'webkitfullscreenchange', function() {
- test("document.getElementById('frame').contentDocument.width==document.width")
- endTest();
- });
-
- runWithKeyDown(function() {
- frame.contentDocument.documentElement.webkitRequestFullScreen();
- });
-}
-</script>
-<iframe id="frame" src="resources/inner.html" width="300" height="100" onload="runTest()" webkitallowfullscreen>
-</iframe>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-with-mixed-allow-webkitallow-attribute-expected.txt b/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-with-mixed-allow-webkitallow-attribute-expected.txt
deleted file mode 100644
index a16b5fd..0000000
--- a/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-with-mixed-allow-webkitallow-attribute-expected.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Test entering full screen for a nested iframe works with a mixture of both allowfullscreen and webkitallowfullscreen.
-
-To test manually, click into inner frame, the page should enter full screen mode.
-
-SUCCEED - entered full screen!
-END OF TEST
-
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-zIndex.html b/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-zIndex.html
index 06d9711..a2e93041 100644
--- a/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-zIndex.html
+++ b/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-zIndex.html
@@ -3,7 +3,7 @@
<head>
<script>
var runPixelTests = true;
-
+
function init() {
// Bail out early if the full screen API is not enabled or is missing:
if (Element.prototype.webkitRequestFullScreen == undefined) {
@@ -16,7 +16,7 @@
runWithKeyDown(goFullScreen);
}
}
-
+
function goFullScreen() {
var iframe = document.getElementById('block1');
var element = iframe.contentDocument.documentElement;
@@ -49,5 +49,6 @@
After entering full screen mode, only a white box should be visible.
Click <button onclick="goFullScreen()">go full screen</button> to run the test.</div>
<div id="block2"></div>
- <iframe webkitallowfullscreen src="resources/inner.html" id="block1"></iframe>
+ <iframe allowfullscreen src="resources/inner.html" id="block1"></iframe>
</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-remove-ancestor-during-transition.html b/third_party/WebKit/LayoutTests/fullscreen/full-screen-remove-ancestor-during-transition.html
index a6646813..238ea9b 100644
--- a/third_party/WebKit/LayoutTests/fullscreen/full-screen-remove-ancestor-during-transition.html
+++ b/third_party/WebKit/LayoutTests/fullscreen/full-screen-remove-ancestor-during-transition.html
@@ -1,3 +1,4 @@
+<!DOCTYPE html>
<script src="../resources/js-test.js"></script>
<script>
if (window.testRunner) {
@@ -39,6 +40,6 @@
}
</script>
<body onload="init()">
- <iframe webkitallowfullscreen src="resources/inner.html" id="block1"></iframe>
+ <iframe allowfullscreen src="resources/inner.html" id="block1"></iframe>
PASS
</body>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-restrictions.html b/third_party/WebKit/LayoutTests/fullscreen/full-screen-restrictions.html
index 4ad8440..e86e0fd 100644
--- a/third_party/WebKit/LayoutTests/fullscreen/full-screen-restrictions.html
+++ b/third_party/WebKit/LayoutTests/fullscreen/full-screen-restrictions.html
@@ -1,3 +1,4 @@
+<!DOCTYPE html>
<body onload="runTest();">
<div>This tests the restrictions to entering full screen mode laid out in section 4.1 of the W3C
<a href="http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html">Full Screen API</a></div>
@@ -31,7 +32,7 @@
waitForEventOnce(document, 'webkitfullscreenchange', function() {
waitForEventOnce(document, 'webkitfullscreenerror', function() {
waitForEventOnce(document, 'webkitfullscreenchange', step4);
- document.webkitExitFullscreen();
+ document.webkitExitFullscreen();
});
runWithKeyDown(function(){div2.webkitRequestFullscreen()});
});
@@ -41,13 +42,13 @@
var step4 = function() {
consoleWrite('"A descendant browsing context\'s document has a non-empty fullscreen element stack."');
var iframe = document.documentElement.appendChild(document.createElement('iframe'));
- iframe.setAttribute('webkitallowfullscreen', 'true');
+ iframe.setAttribute('allowfullscreen', 'true');
var div = iframe.contentDocument.documentElement.appendChild(iframe.contentDocument.createElement('div'));
var div2 = document.documentElement.appendChild(document.createElement('div'));
waitForEventOnce(iframe.contentDocument, 'webkitfullscreenchange', function() {
waitForEventOnce(document, 'webkitfullscreenerror', function(){
waitForEventOnce(iframe.contentDocument, 'webkitfullscreenchange', step5);
- iframe.contentDocument.webkitExitFullscreen();
+ iframe.contentDocument.webkitExitFullscreen();
});
runWithKeyDown(function(){div2.webkitRequestFullscreen()});
});
diff --git a/third_party/WebKit/LayoutTests/fullscreen/resources/full-screen-iframe-allowed-nested1.html b/third_party/WebKit/LayoutTests/fullscreen/resources/full-screen-iframe-allowed-nested1.html
new file mode 100644
index 0000000..dbc5ef00
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fullscreen/resources/full-screen-iframe-allowed-nested1.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+iframe1
+<iframe allowfullscreen src="full-screen-iframe-allowed-nested2.html">
+</iframe>
+<script>
+window.onmessage = function (messageEvent) {
+ parent.postMessage(messageEvent.data, "*");
+}
+</script>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/resources/full-screen-iframe-with-mixed-allow-webkitallow-iframe2.html b/third_party/WebKit/LayoutTests/fullscreen/resources/full-screen-iframe-allowed-nested2.html
similarity index 87%
rename from third_party/WebKit/LayoutTests/fullscreen/resources/full-screen-iframe-with-mixed-allow-webkitallow-iframe2.html
rename to third_party/WebKit/LayoutTests/fullscreen/resources/full-screen-iframe-allowed-nested2.html
index c064aa2..4523d54 100644
--- a/third_party/WebKit/LayoutTests/fullscreen/resources/full-screen-iframe-with-mixed-allow-webkitallow-iframe2.html
+++ b/third_party/WebKit/LayoutTests/fullscreen/resources/full-screen-iframe-allowed-nested2.html
@@ -1,9 +1,10 @@
+<!DOCTYPE html>
<body onload='parent.postMessage("onload", "*");'>
iframe2<br>
Manual test: click here.
<script src="../full-screen-test.js"></script>
<script>
- document.body.onclick = function() {
+ window.onclick = function() {
document.body.webkitRequestFullScreen();
};
waitForEvent(document, 'webkitfullscreenchange', function() {
diff --git a/third_party/WebKit/LayoutTests/fullscreen/resources/full-screen-iframe-with-mixed-allow-webkitallow-iframe1.html b/third_party/WebKit/LayoutTests/fullscreen/resources/full-screen-iframe-with-mixed-allow-webkitallow-iframe1.html
deleted file mode 100644
index 08cf6b34..0000000
--- a/third_party/WebKit/LayoutTests/fullscreen/resources/full-screen-iframe-with-mixed-allow-webkitallow-iframe1.html
+++ /dev/null
@@ -1,9 +0,0 @@
-iframe1
-<iframe allowfullscreen src="full-screen-iframe-with-mixed-allow-webkitallow-iframe2.html">
-</iframe>
-<script>
-window.onmessage = function (messageEvent) {
- parent.postMessage(messageEvent.data, "*");
-}
-</script>
-
diff --git a/third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp b/third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp
index cdee8947..d153ed3 100644
--- a/third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp
+++ b/third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp
@@ -52,12 +52,8 @@
do {
if (!isHTMLIFrameElement(owner))
return false;
- if (!owner->hasAttribute(allowfullscreenAttr)) {
- if (owner->hasAttribute(webkitallowfullscreenAttr))
- UseCounter::count(document, UseCounter::PrefixedAllowFullscreenAttribute);
- else
- return false;
- }
+ if (!owner->hasAttribute(allowfullscreenAttr))
+ return false;
} while ((owner = owner->document().ownerElement()));
return true;
}
diff --git a/third_party/WebKit/Source/core/frame/UseCounter.h b/third_party/WebKit/Source/core/frame/UseCounter.h
index e579434a..0e9b47a 100644
--- a/third_party/WebKit/Source/core/frame/UseCounter.h
+++ b/third_party/WebKit/Source/core/frame/UseCounter.h
@@ -309,7 +309,6 @@
NamedNodeMapRemoveNamedItemNS = 312,
OpenWebDatabaseInWorker = 313, // This didn't work because of crbug.com/376039. Available since M37.
OpenWebDatabaseSyncInWorker = 314, // This didn't work because of crbug.com/376039. Available since M37.
- PrefixedAllowFullscreenAttribute = 315,
XHRProgressEventPosition = 316,
XHRProgressEventTotalSize = 317,
PrefixedDocumentIsFullscreen = 318,
diff --git a/third_party/WebKit/Source/core/html/HTMLAttributeNames.in b/third_party/WebKit/Source/core/html/HTMLAttributeNames.in
index 9494fad..8c947f6 100644
--- a/third_party/WebKit/Source/core/html/HTMLAttributeNames.in
+++ b/third_party/WebKit/Source/core/html/HTMLAttributeNames.in
@@ -342,7 +342,6 @@
version
vlink
vspace
-webkitallowfullscreen
webkitdirectory
width
wrap