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

Unified Diff: client/html/dartium/html_dartium.dart

Issue 9662010: Don't put private members in dart:html interfaces. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 8 years, 9 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:
Download patch
« no previous file with comments | « client/dom/templates/html/impl/impl_Node.darttemplate ('k') | client/html/frog/html_frog.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/html/dartium/html_dartium.dart
diff --git a/client/html/dartium/html_dartium.dart b/client/html/dartium/html_dartium.dart
index 0ce5db7019e9a94689973128f1c9549b8a54cecd..c3f0c10575adba1c85ebe3ffbe31c6c58d29a421 100644
--- a/client/html/dartium/html_dartium.dart
+++ b/client/html/dartium/html_dartium.dart
@@ -7516,8 +7516,8 @@ class _ElementImpl extends _NodeImpl implements Element {
}
Future<CSSStyleDeclaration> getComputedStyle(String pseudoElement) {
- return _createMeasurementFuture(() =>
- window._getComputedStyle(this, pseudoElement),
+ return _createMeasurementFuture(
+ () => _window._getComputedStyle(this, pseudoElement),
new Completer<CSSStyleDeclaration>());
}
_ElementImpl._wrap(ptr) : super._wrap(ptr);
@@ -11762,14 +11762,16 @@ class _NodeImpl extends _EventTargetImpl implements Node {
// TODO(jacobr): should we throw an exception if parent is already null?
_NodeImpl remove() {
if (this.parent != null) {
- this.parent._removeChild(this);
+ final _NodeImpl parent = this.parent;
+ parent._removeChild(this);
}
return this;
}
_NodeImpl replaceWith(Node otherNode) {
try {
- this.parent._replaceChild(otherNode, this);
+ final _NodeImpl parent = this.parent;
+ parent._replaceChild(otherNode, this);
} catch(var e) {
};
@@ -21112,12 +21114,6 @@ class _XSLTProcessorFactoryProvider {
interface AbstractWorker extends EventTarget {
AbstractWorkerEvents get on();
-
- void _addEventListener(String type, EventListener listener, [bool useCapture]);
-
- bool _dispatchEvent(Event evt);
-
- void _removeEventListener(String type, EventListener listener, [bool useCapture]);
}
interface AbstractWorkerEvents extends Events {
@@ -24622,12 +24618,6 @@ interface DOMApplicationCache extends EventTarget {
void abort();
- void _addEventListener(String type, EventListener listener, [bool useCapture]);
-
- bool _dispatchEvent(Event evt);
-
- void _removeEventListener(String type, EventListener listener, [bool useCapture]);
-
void swapCache();
void update();
@@ -25253,18 +25243,10 @@ interface Document extends HtmlElement {
DocumentFragment createDocumentFragment();
- Element _createElement(String tagName);
-
- Event _createEvent(String eventType);
-
Range createRange();
- Text _createTextNode(String data);
-
Touch createTouch(Window window, EventTarget target, int identifier, int pageX, int pageY, int screenX, int screenY, int webkitRadiusX, int webkitRadiusY, num webkitRotationAngle, num webkitForce);
- TouchList _createTouchList();
-
Element elementFromPoint(int x, int y);
bool execCommand(String command, bool userInterface, String value);
@@ -25394,8 +25376,6 @@ interface DocumentFragment extends Node, NodeSelector {
ElementEvents get on();
Element query(String selectors);
-
- NodeList _querySelectorAll(String selectors);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -25736,28 +25716,12 @@ interface Element extends Node, NodeSelector default _ElementFactoryProvider {
static final int ALLOW_KEYBOARD_INPUT = 1;
- final int _childElementCount;
-
- final HTMLCollection _children;
-
- String _className;
-
- final int _clientHeight;
-
- final int _clientLeft;
-
- final int _clientTop;
-
- final int _clientWidth;
-
String contentEditable;
String dir;
bool draggable;
- final Element _firstElementChild;
-
bool hidden;
String id;
@@ -25772,28 +25736,12 @@ interface Element extends Node, NodeSelector default _ElementFactoryProvider {
final Element nextElementSibling;
- final int _offsetHeight;
-
- final int _offsetLeft;
-
final Element offsetParent;
- final int _offsetTop;
-
- final int _offsetWidth;
-
final String outerHTML;
final Element previousElementSibling;
- final int _scrollHeight;
-
- int _scrollLeft;
-
- int _scrollTop;
-
- final int _scrollWidth;
-
bool spellcheck;
final CSSStyleDeclaration style;
@@ -25816,14 +25764,6 @@ interface Element extends Node, NodeSelector default _ElementFactoryProvider {
void focus();
- String _getAttribute(String name);
-
- ClientRect _getBoundingClientRect();
-
- ClientRectList _getClientRects();
-
- bool _hasAttribute(String name);
-
Element insertAdjacentElement(String where, Element element);
void insertAdjacentHTML(String where, String html);
@@ -25832,18 +25772,12 @@ interface Element extends Node, NodeSelector default _ElementFactoryProvider {
Element query(String selectors);
- NodeList _querySelectorAll(String selectors);
-
- void _removeAttribute(String name);
-
void scrollByLines(int lines);
void scrollByPages(int pages);
void scrollIntoView([bool centerIfNeeded]);
- void _setAttribute(String name, String value);
-
bool matchesSelector(String selectors);
void webkitRequestFullScreen(int flags);
@@ -26219,8 +26153,6 @@ interface Event default _EventFactoryProvider {
final String type;
- void _initEvent(String eventTypeArg, bool canBubbleArg, bool cancelableArg);
-
void preventDefault();
void stopImmediatePropagation();
@@ -26271,13 +26203,7 @@ interface EventSource extends EventTarget default _EventSourceFactoryProvider {
final String url;
- void _addEventListener(String type, EventListener listener, [bool useCapture]);
-
void close();
-
- bool _dispatchEvent(Event evt);
-
- void _removeEventListener(String type, EventListener listener, [bool useCapture]);
}
interface EventSourceEvents extends Events {
@@ -26310,12 +26236,6 @@ interface EventTarget {
final Events on;
- void _addEventListener(String type, EventListener listener, [bool useCapture]);
-
- bool _dispatchEvent(Event event);
-
- void _removeEventListener(String type, EventListener listener, [bool useCapture]);
-
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -28222,16 +28142,10 @@ interface MessagePort extends EventTarget {
MessagePortEvents get on();
- void _addEventListener(String type, EventListener listener, [bool useCapture]);
-
void close();
- bool _dispatchEvent(Event evt);
-
void postMessage(String message, [List messagePorts]);
- void _removeEventListener(String type, EventListener listener, [bool useCapture]);
-
void start();
void webkitPostMessage(String message, [List transfer]);
@@ -28359,8 +28273,6 @@ interface MouseEvent extends UIEvent default _MouseEventFactoryProvider {
final int x;
final int y;
-
- void _initMouseEvent(String type, bool canBubble, bool cancelable, Window view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, int button, EventTarget relatedTarget);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -28536,10 +28448,6 @@ interface Node extends EventTarget {
static final int TEXT_NODE = 3;
- final NamedNodeMap _attributes;
-
- final NodeList _childNodes;
-
final Node nextNode;
final Document document;
@@ -28550,8 +28458,6 @@ interface Node extends EventTarget {
String text;
- Node _appendChild(Node newChild);
-
Node clone(bool deep);
bool contains(Node other);
@@ -28560,10 +28466,6 @@ interface Node extends EventTarget {
Node insertBefore(Node newChild, Node refChild);
- Node _removeChild(Node oldChild);
-
- Node _replaceChild(Node newChild, Node oldChild);
-
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -28665,8 +28567,6 @@ interface NodeSelector {
Element query(String selectors);
- NodeList _querySelectorAll(String selectors);
-
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -29926,8 +29826,6 @@ interface SVGDescElement extends SVGElement, SVGLangSpace, SVGStylable {
interface SVGDocument extends Document {
final SVGSVGElement rootElement;
-
- Event _createEvent(String eventType);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -29970,12 +29868,6 @@ interface SVGElementInstance extends EventTarget {
final SVGElementInstance parentNode;
final SVGElementInstance previousSibling;
-
- void _addEventListener(String type, EventListener listener, [bool useCapture]);
-
- bool _dispatchEvent(Event event);
-
- void _removeEventListener(String type, EventListener listener, [bool useCapture]);
}
interface SVGElementInstanceEvents extends Events {
@@ -31826,8 +31718,6 @@ interface SVGStringList {
interface SVGStylable {
- final SVGAnimatedString _svgClassName;
-
final CSSStyleDeclaration style;
CSSValue getPresentationAttribute(String name);
@@ -34442,14 +34332,8 @@ interface WebSocket extends EventTarget {
final String url;
- void _addEventListener(String type, EventListener listener, [bool useCapture]);
-
void close([int code, String reason]);
- bool _dispatchEvent(Event evt);
-
- void _removeEventListener(String type, EventListener listener, [bool useCapture]);
-
bool send(String data);
}
@@ -34627,8 +34511,6 @@ interface Window extends EventTarget {
final Window window;
- void _addEventListener(String type, EventListener listener, [bool useCapture]);
-
void alert(String message);
String atob(String string);
@@ -34647,14 +34529,10 @@ interface Window extends EventTarget {
bool confirm(String message);
- bool _dispatchEvent(Event evt);
-
bool find(String string, bool caseSensitive, bool backwards, bool wrap, bool wholeWord, bool searchInFrames, bool showDialog);
void focus();
- CSSStyleDeclaration _getComputedStyle(Element element, String pseudoElement);
-
CSSRuleList getMatchedCSSRules(Element element, String pseudoElement);
DOMSelection getSelection();
@@ -34677,8 +34555,6 @@ interface Window extends EventTarget {
void releaseEvents();
- void _removeEventListener(String type, EventListener listener, [bool useCapture]);
-
void resizeBy(num x, num y);
void resizeTo(num width, num height);
@@ -35035,10 +34911,6 @@ interface XMLHttpRequest extends EventTarget default _XMLHttpRequestFactoryProvi
void abort();
- void _addEventListener(String type, EventListener listener, [bool useCapture]);
-
- bool _dispatchEvent(Event evt);
-
String getAllResponseHeaders();
String getResponseHeader(String header);
@@ -35047,8 +34919,6 @@ interface XMLHttpRequest extends EventTarget default _XMLHttpRequestFactoryProvi
void overrideMimeType(String override);
- void _removeEventListener(String type, EventListener listener, [bool useCapture]);
-
void send([var data]);
void setRequestHeader(String header, String value);
@@ -35111,12 +34981,6 @@ interface XMLHttpRequestProgressEvent extends ProgressEvent {
interface XMLHttpRequestUpload extends EventTarget {
XMLHttpRequestUploadEvents get on();
-
- void _addEventListener(String type, EventListener listener, [bool useCapture]);
-
- bool _dispatchEvent(Event evt);
-
- void _removeEventListener(String type, EventListener listener, [bool useCapture]);
}
interface XMLHttpRequestUploadEvents extends Events {
@@ -35932,13 +35796,13 @@ class _XMLHttpRequestUtils {
class _TextFactoryProvider {
- factory Text(String data) => document._createTextNode(data);
+ factory Text(String data) => _document._createTextNode(data);
}
class _EventFactoryProvider {
factory Event(String type, [bool canBubble = true,
bool cancelable = true]) {
- _EventImpl e = document._createEvent("Event");
+ final _EventImpl e = _document._createEvent("Event");
e._initEvent(type, canBubble, cancelable);
return e;
}
@@ -35950,7 +35814,7 @@ class _MouseEventFactoryProvider {
[bool canBubble = true, bool cancelable = true, bool ctrlKey = false,
bool altKey = false, bool shiftKey = false, bool metaKey = false,
EventTarget relatedTarget = null]) {
- final e = document._createEvent("MouseEvent");
+ final e = _document._createEvent("MouseEvent");
e._initMouseEvent(type, canBubble, cancelable, view, detail,
screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey,
button, relatedTarget);
@@ -36003,8 +35867,7 @@ class _ElementFactoryProvider {
parentTag = _CUSTOM_PARENT_TAG_MAP[tag];
}
}
- // TODO(jacobr): make type dom.HTMLElement when dartium allows it.
- _ElementImpl temp = document._createElement(parentTag);
+ final _ElementImpl temp = new Element.tag(parentTag);
temp.innerHTML = html;
Element element;
@@ -36024,9 +35887,7 @@ class _ElementFactoryProvider {
}
/** @domName Document.createElement */
- factory Element.tag(String tag) {
- return document._createElement(tag);
- }
+ factory Element.tag(String tag) => _document._createElement(tag);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -36241,10 +36102,12 @@ class _Device {
*/
class Testing {
static void addEventListener(EventTarget target, String type, EventListener listener, bool useCapture) {
- target._addEventListener(type, listener, useCapture);
+ final _EventTargetImpl targetImpl = target;
+ targetImpl._addEventListener(type, listener, useCapture);
}
static void removeEventListener(EventTarget target, String type, EventListener listener, bool useCapture) {
- target._removeEventListener(type, listener, useCapture);
+ final _EventTargetImpl targetImpl = target;
+ targetImpl._removeEventListener(type, listener, useCapture);
}
}// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
« no previous file with comments | « client/dom/templates/html/impl/impl_Node.darttemplate ('k') | client/html/frog/html_frog.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698