<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[209733] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/209733">209733</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-12-12 15:27:13 -0800 (Mon, 12 Dec 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Document.visibilityState should use an IDL string enumeration
https://bugs.webkit.org/show_bug.cgi?id=165774
Reviewed by Daniel Bates.
Source/WebCore:
Document.visibilityState should use an IDL string enumeration:
- http://w3c.github.io/page-visibility/#extensions-to-the-document-interface
No new tests, there should be no Web-exposed behavior change.
* CMakeLists.txt:
* Modules/vibration/NavigatorVibration.cpp:
(WebCore::NavigatorVibration::vibrate):
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::hidden):
(WebCore::Document::pageVisibilityState): Deleted.
(WebCore::Document::visibilityState): Deleted.
* dom/Document.h:
* dom/Document.idl:
* page/Page.cpp:
(WebCore::Page::visibilityState):
* page/PageVisibilityState.cpp: Removed.
* page/PageVisibilityState.h:
(): Deleted.
Source/WebKit/mac:
* DOM/DOMDocument.mm:
(-[DOMDocument visibilityState]):
* WebView/WebView.mm:
(kit):
Source/WebKit2:
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toPageVisibilityState):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesvibrationNavigatorVibrationcpp">trunk/Source/WebCore/Modules/vibration/NavigatorVibration.cpp</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoredomDocumentidl">trunk/Source/WebCore/dom/Document.idl</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageVisibilityStateh">trunk/Source/WebCore/page/PageVisibilityState.h</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMDocumentmm">trunk/Source/WebKit/mac/DOM/DOMDocument.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedAPIcWKSharedAPICasth">trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorepagePageVisibilityStatecpp">trunk/Source/WebCore/page/PageVisibilityState.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (209732 => 209733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-12-12 23:25:45 UTC (rev 209732)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-12-12 23:27:13 UTC (rev 209733)
</span><span class="lines">@@ -2056,7 +2056,6 @@
</span><span class="cx"> page/PageOverlay.cpp
</span><span class="cx"> page/PageOverlayController.cpp
</span><span class="cx"> page/PageSerializer.cpp
</span><del>- page/PageVisibilityState.cpp
</del><span class="cx"> page/Performance.cpp
</span><span class="cx"> page/PerformanceEntry.cpp
</span><span class="cx"> page/PerformanceLogging.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (209732 => 209733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-12-12 23:25:45 UTC (rev 209732)
+++ trunk/Source/WebCore/ChangeLog        2016-12-12 23:27:13 UTC (rev 209733)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2016-12-12 Chris Dumez <cdumez@apple.com>
+
+ Document.visibilityState should use an IDL string enumeration
+ https://bugs.webkit.org/show_bug.cgi?id=165774
+
+ Reviewed by Daniel Bates.
+
+ Document.visibilityState should use an IDL string enumeration:
+ - http://w3c.github.io/page-visibility/#extensions-to-the-document-interface
+
+ No new tests, there should be no Web-exposed behavior change.
+
+ * CMakeLists.txt:
+ * Modules/vibration/NavigatorVibration.cpp:
+ (WebCore::NavigatorVibration::vibrate):
+ * WebCore.xcodeproj/project.pbxproj:
+ * dom/Document.cpp:
+ (WebCore::Document::hidden):
+ (WebCore::Document::pageVisibilityState): Deleted.
+ (WebCore::Document::visibilityState): Deleted.
+ * dom/Document.h:
+ * dom/Document.idl:
+ * page/Page.cpp:
+ (WebCore::Page::visibilityState):
+ * page/PageVisibilityState.cpp: Removed.
+ * page/PageVisibilityState.h:
+ (): Deleted.
+
</ins><span class="cx"> 2016-12-12 Jer Noble <jer.noble@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove implementation of legacy Mozilla-based Fullscreen API.
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesvibrationNavigatorVibrationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/vibration/NavigatorVibration.cpp (209732 => 209733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/vibration/NavigatorVibration.cpp        2016-12-12 23:25:45 UTC (rev 209732)
+++ trunk/Source/WebCore/Modules/vibration/NavigatorVibration.cpp        2016-12-12 23:27:13 UTC (rev 209733)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> if (!navigator.frame()->page())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (navigator.frame()->page()->visibilityState() == PageVisibilityStateHidden)
</del><ins>+ if (navigator.frame()->page()->visibilityState() == PageVisibilityState::Hidden)
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> return Vibration::from(navigator.frame()->page())->vibrate(pattern);
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (209732 => 209733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-12 23:25:45 UTC (rev 209732)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-12 23:27:13 UTC (rev 209733)
</span><span class="lines">@@ -6859,7 +6859,6 @@
</span><span class="cx">                 FFAC30FF184FB145008C4F1E /* TrailingObjects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFAC30FD184FB145008C4F1E /* TrailingObjects.cpp */; };
</span><span class="cx">                 FFB698CC1833EE0D00158A31 /* LineBreaker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFB698CA1833EC3800158A31 /* LineBreaker.cpp */; };
</span><span class="cx">                 FFB698CF183402BB00158A31 /* LineInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFB698CD1833F17600158A31 /* LineInfo.cpp */; };
</span><del>-                FFD5B97A135CC97800D5E92A /* PageVisibilityState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFD5B977135CC97800D5E92A /* PageVisibilityState.cpp */; };
</del><span class="cx">                 FFD5B97B135CC97800D5E92A /* PageVisibilityState.h in Headers */ = {isa = PBXBuildFile; fileRef = FFD5B978135CC97800D5E92A /* PageVisibilityState.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FFDBC047183D27B700407109 /* LineWidth.h in Headers */ = {isa = PBXBuildFile; fileRef = FFDBC045183D27B700407109 /* LineWidth.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FFDBC048183D27B700407109 /* LineWidth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFDBC046183D27B700407109 /* LineWidth.cpp */; };
</span><span class="lines">@@ -14921,7 +14920,6 @@
</span><span class="cx">                 FFB698CB1833EC3800158A31 /* LineBreaker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineBreaker.h; sourceTree = "<group>"; };
</span><span class="cx">                 FFB698CD1833F17600158A31 /* LineInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LineInfo.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 FFB698CE1833F17600158A31 /* LineInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineInfo.h; sourceTree = "<group>"; };
</span><del>-                FFD5B977135CC97800D5E92A /* PageVisibilityState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageVisibilityState.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 FFD5B978135CC97800D5E92A /* PageVisibilityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageVisibilityState.h; sourceTree = "<group>"; };
</span><span class="cx">                 FFDBC045183D27B700407109 /* LineWidth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineWidth.h; sourceTree = "<group>"; };
</span><span class="cx">                 FFDBC046183D27B700407109 /* LineWidth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LineWidth.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -17923,7 +17921,6 @@
</span><span class="cx">                                 2D5C9CFE19C7B52E00B3C5C1 /* PageOverlayController.h */,
</span><span class="cx">                                 371E65CD13661EED00BEEDB0 /* PageSerializer.cpp */,
</span><span class="cx">                                 371E65CB13661EDC00BEEDB0 /* PageSerializer.h */,
</span><del>-                                FFD5B977135CC97800D5E92A /* PageVisibilityState.cpp */,
</del><span class="cx">                                 FFD5B978135CC97800D5E92A /* PageVisibilityState.h */,
</span><span class="cx">                                 E526AF3E1727F8F200E41781 /* Performance.cpp */,
</span><span class="cx">                                 8A844D0211D3C18E0014065C /* Performance.h */,
</span><span class="lines">@@ -30740,7 +30737,6 @@
</span><span class="cx">                                 371E65CE13661EED00BEEDB0 /* PageSerializer.cpp in Sources */,
</span><span class="cx">                                 E1284AEA10447DEE00EAEB52 /* PageTransitionEvent.cpp in Sources */,
</span><span class="cx">                                 51E1ECC20C91C90400DC255B /* PageURLRecord.cpp in Sources */,
</span><del>-                                FFD5B97A135CC97800D5E92A /* PageVisibilityState.cpp in Sources */,
</del><span class="cx">                                 FD3160A212B026F700C1A359 /* Panner.cpp in Sources */,
</span><span class="cx">                                 FD31601912B0267600C1A359 /* PannerNode.cpp in Sources */,
</span><span class="cx">                                 A18890AE1AA13F250026C301 /* ParentalControlsContentFilter.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (209732 => 209733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-12-12 23:25:45 UTC (rev 209732)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-12-12 23:27:13 UTC (rev 209733)
</span><span class="lines">@@ -1622,7 +1622,7 @@
</span><span class="cx"> element->visibilityStateChanged();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PageVisibilityState Document::pageVisibilityState() const
</del><ins>+auto Document::visibilityState() const -> VisibilityState
</ins><span class="cx"> {
</span><span class="cx"> // The visibility of the document is inherited from the visibility of the
</span><span class="cx"> // page. If there is no page associated with the document, we will assume
</span><span class="lines">@@ -1629,18 +1629,13 @@
</span><span class="cx"> // that the page is hidden, as specified by the spec:
</span><span class="cx"> // http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PageVisibility/Overview.html#dom-document-hidden
</span><span class="cx"> if (!m_frame || !m_frame->page())
</span><del>- return PageVisibilityStateHidden;
</del><ins>+ return VisibilityState::Hidden;
</ins><span class="cx"> return m_frame->page()->visibilityState();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String Document::visibilityState() const
-{
- return pageVisibilityStateString(pageVisibilityState());
-}
-
</del><span class="cx"> bool Document::hidden() const
</span><span class="cx"> {
</span><del>- return pageVisibilityState() != PageVisibilityStateVisible;
</del><ins>+ return visibilityState() != VisibilityState::Visible;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO)
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (209732 => 209733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2016-12-12 23:25:45 UTC (rev 209732)
+++ trunk/Source/WebCore/dom/Document.h        2016-12-12 23:27:13 UTC (rev 209733)
</span><span class="lines">@@ -444,8 +444,9 @@
</span><span class="cx"> void setInputCursor(Ref<JSC::InputCursor>&&);
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+ using VisibilityState = PageVisibilityState;
+ WEBCORE_EXPORT VisibilityState visibilityState() const;
</ins><span class="cx"> void visibilityStateChanged();
</span><del>- WEBCORE_EXPORT String visibilityState() const;
</del><span class="cx"> WEBCORE_EXPORT bool hidden() const;
</span><span class="cx">
</span><span class="cx"> void setTimerThrottlingEnabled(bool);
</span><span class="lines">@@ -1356,8 +1357,6 @@
</span><span class="cx"> template <typename CharacterType>
</span><span class="cx"> void displayBufferModifiedByEncodingInternal(CharacterType*, unsigned) const;
</span><span class="cx">
</span><del>- PageVisibilityState pageVisibilityState() const;
-
</del><span class="cx"> template <CollectionType collectionType>
</span><span class="cx"> Ref<HTMLCollection> ensureCachedCollection();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.idl (209732 => 209733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.idl        2016-12-12 23:25:45 UTC (rev 209732)
+++ trunk/Source/WebCore/dom/Document.idl        2016-12-12 23:27:13 UTC (rev 209733)
</span><span class="lines">@@ -170,8 +170,10 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> // Page visibility API.
</span><del>- readonly attribute DOMString visibilityState;
</del><ins>+ readonly attribute VisibilityState visibilityState;
</ins><span class="cx"> readonly attribute boolean hidden;
</span><ins>+ // FIXME: We should implement this.
+ // attribute EventHandler onvisibilitychange;
</ins><span class="cx">
</span><span class="cx"> // currentscript API: http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#dom-document-currentscript
</span><span class="cx"> readonly attribute HTMLScriptElement? currentScript;
</span><span class="lines">@@ -205,6 +207,12 @@
</span><span class="cx"> [NotEnumerable, Conditional=POINTER_LOCK] attribute EventHandler onpointerlockerror;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+enum VisibilityState {
+ "hidden",
+ "visible",
+ "prerender"
+};
+
</ins><span class="cx"> Document implements ParentNode;
</span><span class="cx"> Document implements NonElementParentNode;
</span><span class="cx"> Document implements DocumentOrShadowRoot;
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (209732 => 209733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2016-12-12 23:25:45 UTC (rev 209732)
+++ trunk/Source/WebCore/page/Page.cpp        2016-12-12 23:27:13 UTC (rev 209733)
</span><span class="lines">@@ -1534,10 +1534,10 @@
</span><span class="cx"> PageVisibilityState Page::visibilityState() const
</span><span class="cx"> {
</span><span class="cx"> if (isVisible())
</span><del>- return PageVisibilityStateVisible;
</del><ins>+ return PageVisibilityState::Visible;
</ins><span class="cx"> if (m_isPrerender)
</span><del>- return PageVisibilityStatePrerender;
- return PageVisibilityStateHidden;
</del><ins>+ return PageVisibilityState::Prerender;
+ return PageVisibilityState::Hidden;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(RUBBER_BANDING)
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageVisibilityStatecpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/page/PageVisibilityState.cpp (209732 => 209733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageVisibilityState.cpp        2016-12-12 23:25:45 UTC (rev 209732)
+++ trunk/Source/WebCore/page/PageVisibilityState.cpp        2016-12-12 23:27:13 UTC (rev 209733)
</span><span class="lines">@@ -1,57 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Google 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:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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 "PageVisibilityState.h"
-
-#include <wtf/NeverDestroyed.h>
-
-namespace WebCore {
-
-String pageVisibilityStateString(PageVisibilityState state)
-{
- static NeverDestroyed<const String> visible(ASCIILiteral("visible"));
- static NeverDestroyed<const String> hidden(ASCIILiteral("hidden"));
- static NeverDestroyed<const String> prerender(ASCIILiteral("prerender"));
-
- switch (state) {
- case PageVisibilityStateVisible:
- return visible;
- case PageVisibilityStateHidden:
- return hidden;
- case PageVisibilityStatePrerender:
- return prerender;
- }
-
- ASSERT_NOT_REACHED();
- return String();
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCorepagePageVisibilityStateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageVisibilityState.h (209732 => 209733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageVisibilityState.h        2016-12-12 23:25:45 UTC (rev 209732)
+++ trunk/Source/WebCore/page/PageVisibilityState.h        2016-12-12 23:27:13 UTC (rev 209733)
</span><span class="lines">@@ -34,14 +34,10 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-// The enum is not flag protected as it is used in the WebKit chromium API
-// without flag protection.
-enum PageVisibilityState {
- PageVisibilityStateVisible,
- PageVisibilityStateHidden,
- PageVisibilityStatePrerender
</del><ins>+enum class PageVisibilityState {
+ Hidden,
+ Visible,
+ Prerender
</ins><span class="cx"> };
</span><span class="cx">
</span><del>-String pageVisibilityStateString(PageVisibilityState);
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (209732 => 209733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-12-12 23:25:45 UTC (rev 209732)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-12-12 23:27:13 UTC (rev 209733)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-12-12 Chris Dumez <cdumez@apple.com>
+
+ Document.visibilityState should use an IDL string enumeration
+ https://bugs.webkit.org/show_bug.cgi?id=165774
+
+ Reviewed by Daniel Bates.
+
+ * DOM/DOMDocument.mm:
+ (-[DOMDocument visibilityState]):
+ * WebView/WebView.mm:
+ (kit):
+
</ins><span class="cx"> 2016-12-12 Jer Noble <jer.noble@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove implementation of legacy Mozilla-based Fullscreen API.
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMDocumentmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/DOMDocument.mm (209732 => 209733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOMDocument.mm        2016-12-12 23:25:45 UTC (rev 209732)
+++ trunk/Source/WebKit/mac/DOM/DOMDocument.mm        2016-12-12 23:27:13 UTC (rev 209733)
</span><span class="lines">@@ -381,7 +381,14 @@
</span><span class="cx"> - (NSString *)visibilityState
</span><span class="cx"> {
</span><span class="cx"> WebCore::JSMainThreadNullState state;
</span><del>- return IMPL->visibilityState();
</del><ins>+ switch (IMPL->visibilityState()) {
+ case WebCore::Document::VisibilityState::Hidden:
+ return @"hidden";
+ case WebCore::Document::VisibilityState::Visible:
+ return @"visible";
+ case WebCore::Document::VisibilityState::Prerender:
+ return @"prerender";
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (BOOL)hidden
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (209732 => 209733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2016-12-12 23:25:45 UTC (rev 209732)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2016-12-12 23:27:13 UTC (rev 209733)
</span><span class="lines">@@ -569,11 +569,11 @@
</span><span class="cx"> static WebPageVisibilityState kit(PageVisibilityState visibilityState)
</span><span class="cx"> {
</span><span class="cx"> switch (visibilityState) {
</span><del>- case PageVisibilityStateVisible:
</del><ins>+ case PageVisibilityState::Visible:
</ins><span class="cx"> return WebPageVisibilityStateVisible;
</span><del>- case PageVisibilityStateHidden:
</del><ins>+ case PageVisibilityState::Hidden:
</ins><span class="cx"> return WebPageVisibilityStateHidden;
</span><del>- case PageVisibilityStatePrerender:
</del><ins>+ case PageVisibilityState::Prerender:
</ins><span class="cx"> return WebPageVisibilityStatePrerender;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (209732 => 209733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-12-12 23:25:45 UTC (rev 209732)
+++ trunk/Source/WebKit2/ChangeLog        2016-12-12 23:27:13 UTC (rev 209733)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-12-12 Chris Dumez <cdumez@apple.com>
+
+ Document.visibilityState should use an IDL string enumeration
+ https://bugs.webkit.org/show_bug.cgi?id=165774
+
+ Reviewed by Daniel Bates.
+
+ * Shared/API/c/WKSharedAPICast.h:
+ (WebKit::toPageVisibilityState):
+
</ins><span class="cx"> 2016-12-11 Konstantin Tokarev <annulen@yandex.ru>
</span><span class="cx">
</span><span class="cx"> Unreviewed attempt to fix EFL and Mac/cmake builds after r209665.
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedAPIcWKSharedAPICasth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h (209732 => 209733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h        2016-12-12 23:25:45 UTC (rev 209732)
+++ trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h        2016-12-12 23:27:13 UTC (rev 209733)
</span><span class="lines">@@ -903,15 +903,15 @@
</span><span class="cx"> {
</span><span class="cx"> switch (wkPageVisibilityState) {
</span><span class="cx"> case kWKPageVisibilityStateVisible:
</span><del>- return WebCore::PageVisibilityStateVisible;
</del><ins>+ return WebCore::PageVisibilityState::Visible;
</ins><span class="cx"> case kWKPageVisibilityStateHidden:
</span><del>- return WebCore::PageVisibilityStateHidden;
</del><ins>+ return WebCore::PageVisibilityState::Hidden;
</ins><span class="cx"> case kWKPageVisibilityStatePrerender:
</span><del>- return WebCore::PageVisibilityStatePrerender;
</del><ins>+ return WebCore::PageVisibilityState::Prerender;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><del>- return WebCore::PageVisibilityStateVisible;
</del><ins>+ return WebCore::PageVisibilityState::Visible;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline ImageOptions toImageOptions(WKImageOptions wkImageOptions)
</span></span></pre>
</div>
</div>
</body>
</html>