Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Side by Side Diff: tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate

Issue 23987002: Fixing visibilityState APIs in Dart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // WARNING: Do not edit - generated code. 5 // WARNING: Do not edit - generated code.
6 6
7 part of $LIBRARYNAME; 7 part of $LIBRARYNAME;
8 8
9 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { 9 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
10 $!MEMBERS 10 $!MEMBERS
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 @Experimental() 153 @Experimental()
154 bool get isFullScreen => _webkitIsFullScreen; 154 bool get isFullScreen => _webkitIsFullScreen;
155 155
156 @DomName('Document.webkitPointerLockElement') 156 @DomName('Document.webkitPointerLockElement')
157 @SupportedBrowser(SupportedBrowser.CHROME) 157 @SupportedBrowser(SupportedBrowser.CHROME)
158 @SupportedBrowser(SupportedBrowser.SAFARI) 158 @SupportedBrowser(SupportedBrowser.SAFARI)
159 @Experimental() 159 @Experimental()
160 Element get pointerLockElement => 160 Element get pointerLockElement =>
161 _webkitPointerLockElement; 161 _webkitPointerLockElement;
162 162
163 @DomName('Document.webkitVisibilityState') 163 @DomName('Document.visibilityState')
164 @SupportedBrowser(SupportedBrowser.CHROME) 164 @SupportedBrowser(SupportedBrowser.CHROME)
165 @SupportedBrowser(SupportedBrowser.SAFARI) 165 @SupportedBrowser(SupportedBrowser.FIREFOX)
166 @SupportedBrowser(SupportedBrowser.IE, '10')
166 @Experimental() 167 @Experimental()
168 $if DART2JS
169 String get visibilityState => JS('String',
170 '(#.visibilityState || #.mozVisibilityState || #.msVisibilityState ||'
171 '#.webkitVisibilityState)', this, this, this, this);
172 $else
167 String get visibilityState => _webkitVisibilityState; 173 String get visibilityState => _webkitVisibilityState;
174 $endif
168 175
169 @Experimental 176 @Experimental
170 $if DART2JS 177 $if DART2JS
171 void register(String tag, Type customElementClass) { 178 void register(String tag, Type customElementClass) {
172 _registerCustomElement(JS('', 'window'), this, tag, customElementClass); 179 _registerCustomElement(JS('', 'window'), this, tag, customElementClass);
173 } 180 }
174 $else 181 $else
175 void register(String tag, Type custom) { 182 void register(String tag, Type custom) {
176 _Utils.register(tag, custom); 183 _Utils.register(tag, custom);
177 } 184 }
178 $endif 185 $endif
179 186
180 $if DART2JS 187 $if DART2JS
181 @Creates('Null') // Set from Dart code; does not instantiate a native type. 188 @Creates('Null') // Set from Dart code; does not instantiate a native type.
182 $endif 189 $endif
183 // Note: used to polyfill <template> 190 // Note: used to polyfill <template>
184 Document _templateContentsOwner; 191 Document _templateContentsOwner;
192
193 @DomName('Document.visibilityChange')
194 @SupportedBrowser(SupportedBrowser.CHROME)
195 @SupportedBrowser(SupportedBrowser.FIREFOX)
196 @SupportedBrowser(SupportedBrowser.IE, '10')
197 @Experimental()
198 static const EventStreamProvider<Event> visibilityChangeEvent =
199 const _CustomEventStreamProvider<Event>(
200 _determineVisibilityChangeEventType);
201
202 static String _determineVisibilityChangeEventType(EventTarget e) {
203 $if DART2JS
204 if (JS('bool', '(typeof #.hidden !== "undefined")', e)) {
205 // Opera 12.10 and Firefox 18 and later support
206 return 'visibilitychange';
207 } else if (JS('bool', '(typeof #.mozHidden !== "undefined")', e)) {
208 return 'mozvisibilitychange';
209 } else if (JS('bool', '(typeof #.msHidden !== "undefined")', e)) {
210 return 'msvisibilitychange';
211 } else if (JS('bool', '(typeof #.webkitHidden !== "undefined")', e)) {
212 return 'webkitvisibilitychange';
213 }
214 return 'visibilitychange';
215 $else
216 return 'webkitvisibilitychange';
217 $endif
218 }
219
220 @SupportedBrowser(SupportedBrowser.CHROME)
221 @SupportedBrowser(SupportedBrowser.FIREFOX)
222 @SupportedBrowser(SupportedBrowser.IE, '10')
223 @Experimental()
224 Stream<Event> get onVisibilityChange =>
225 visibilityChangeEvent.forTarget(this);
185 } 226 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698