Commit Graph

37 Commits

Author SHA1 Message Date
Srujan Gaddam 63a57a76ce [dart:html] Revert "[dart:html] Revert commits using MDN compatibility info"
This reverts commit f8ff12008e.

This CL is a revert of the initial revert and should be landed once
Flutter changes have been merged to handle the changes here.

Change-Id: I300a5efd776bf2a596743971f4e15ad62da77f5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153368
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-14 23:18:43 +00:00
Srujan Gaddam f8ff12008e [dart:html] Revert commits using MDN compatibility info
This reverts commits aff77e7e..e24f205d.

Due to a breakage in a Flutter roll, this CL stack needs to be
reverted. It should be reintroduced with changes to Flutter code to
compile with the changes in dart:html.

Breakage: https://github.com/flutter/engine/runs/828631927

Change-Id: I9c93c4eab823337d09d2e347015ad9ec402f2038
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152910
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2020-07-02 01:33:18 +00:00
Srujan Gaddam 7349385185 [dart:html] Changes to template/src to handle compat data
Mostly null-assertions to make code compatible with compat
data changes.

Change-Id: I8f7c6c2421d6427851a44588978910deae8440bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152047
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-01 22:06:34 +00:00
Srujan Gaddam e35f398779 [dart:html] Modify createFragment to take nullable html str
Closes https://github.com/dart-lang/sdk/issues/41699

createFragment should accept a nullable html string in its
implementation. As such, usages of createFragment within dart:html
are modified as well so the html string does not have to be
non-nullable.

Change-Id: Ia04ad2da9e2a48cabda8774f0af75559fb03a7d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145570
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-04-30 16:50:52 +00:00
Srujan Gaddam 2bd4858d40 [dart:html] Use TreatNullAs attribute in nullability
Closes https://github.com/dart-lang/sdk/issues/41419

Uses the external attribute TreatNullAs to allow nullable setters
and parameters.

Change-Id: I5182ac6dcfdcf78e84f204079a782aebbf128a78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143185
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-04-14 00:37:41 +00:00
Srujan Gaddam 3776313e65 Change dart:html templates to generate null-safe code
Introduces NULLASSERT token and NNBD condition to allow code to
conditionally compile with NNBD.

Change-Id: Ib71e439f32c793e69b66c328cd7c9900358d886e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134045
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-06 23:18:24 +00:00
Sam Rawlins d964c50cff clear contents on TemplateElement#setInnerHtml before appending
Fixes #18249

Change-Id: I29b12163ad5809010c4ee4ff4ce892399d26e3ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112485
Reviewed-by: Terry Lucas <terry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-09-06 18:31:59 +00:00
Terry Lucas 8fedfc7f8c Removed DomName, DosEditable, and experimental annoations they are unused.
R=kevmoo@google.com,vsm@google.com

Fixes #32304

Change-Id: Ia2c8f99f0125c4d4bd0f95a792ff2af8a58e3599
Reviewed-on: https://dart-review.googlesource.com/60400
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2018-06-18 18:48:03 +00:00
sra@google.com 7516e95066 Redo "Use @Native annotation on dart2js DOM native classes"
BUG=

Review URL: https://codereview.chromium.org//410863002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38488 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-23 04:27:48 +00:00
sra@google.com 9a4f73207e Revert "Use @Native annotation on dart2js DOM native classes"
TBR=blois@google.com

BUG=

Review URL: https://codereview.chromium.org//410823002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38486 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-23 01:44:13 +00:00
sra@google.com 11a19d95be Use @Native annotation on dart2js DOM native classes
This is one of many steps to removing non-standard syntax from the dart2js libraries.

R=blois@google.com

Review URL: https://codereview.chromium.org//409053002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38484 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-23 00:23:17 +00:00
jmesserly@google.com 360ea42322 Rename mdv -> template_binding, remove experiemntal apis from dart:html
essentially, we trade off reduce dart:html API surface area for more annoying usage of these APIs. Since Polymer hides most of this, I suspect it won't be too annoying in practice.

Sample usage:

    nodeBind(node).bind(...)

    templateBind(node).model = ...;

R=sigmund@google.com

Review URL: https://codereview.chromium.org//34453003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29057 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-23 02:11:49 +00:00
blois@google.com 690a1454e5 Revert "Converting Polymer and TemplateElement to use deprecated Node.document"
Now that DRT is updated and we're running dart2js tests properly, all should be good.

BUG=14197
R=jmesserly@google.com

Review URL: https://codereview.chromium.org//34613005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29018 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-22 18:28:18 +00:00
blois@google.com ee30fc06fb Converting Polymer and TemplateElement to use deprecated Node.document
Because Polymer dart2js tests actually execute dart, the bots are red because the corresponding changes haven't made it into Dartium.

BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org//27773002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28830 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-17 22:04:11 +00:00
blois@google.com e3b35dabb6 Renaming Node.document back to Node.ownerDocument
With custom elements, the document instance variable creates an odd conflict with the document global.

BUG=14099
R=jmesserly@google.com

Review URL: https://codereview.chromium.org//27602002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28810 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-17 17:55:38 +00:00
efortuna@google.com 951dca71cb Deprecate query and queryAll, also add back querySelector and querySelectorAll.
BUG=
R=jacobr@google.com

Review URL: https://codereview.chromium.org//27223003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28699 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-16 00:44:47 +00:00
blois@google.com d312cbbd08 Exposing document.createElement
As part of removing all $dom_ APIs, making this one public. There are valid scenarios for creating elements in other documents.

BUG=
R=efortuna@google.com

Review URL: https://codereview.chromium.org//24084004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27415 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-12 00:00:39 +00:00
blois@google.com 93c361dd36 This is an updated version of https://codereview.chromium.org/16374007/
Original submission is the first patch, fixes are the second.

There were two issues with the original-
  - Issue with URI sanitization where relative URIs on IE were being dropped.
  - Analyzer issue on missing members for CustomElement.

BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org//23525003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26757 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 01:03:01 +00:00
blois@google.com 24e9f22c90 Revert "First rev of Safe DOM"
This reverts commit 26681.

Some IE issues with URL validation that I need to investigate further.

BUG=

Review URL: https://codereview.chromium.org//23523002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26682 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-27 02:18:48 +00:00
blois@google.com 63ecf1a3fd First rev of Safe DOM
BUG=
R=jacobr@google.com, jmesserly@google.com

Review URL: https://codereview.chromium.org//16374007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26681 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-27 01:48:13 +00:00
efortuna@google.com 90873051ad Making almost all dom_ methods private. Exceptions will be addressed in a later CL.
Current ones that still remain to be made private include createElement(NS),
createRange, all the Element properties, and childNodes.

BUG=
R=blois@google.com

Review URL: https://codereview.chromium.org//23055008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26605 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-23 18:25:40 +00:00
jmesserly@google.com 6774f0db6b Custom Syntax's are now enabled via template.bindingDelegate =
port of https://github.com/Polymer/mdv/commit/d4c97a94fe565b07eec174ab27994e67a514ce4b
(except the expression syntax bits -- that's covered in fancy_syntax)
BUG=
R=justinfagnani@google.com

Review URL: https://codereview.chromium.org//19663011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25371 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-23 21:48:53 +00:00
jmesserly@google.com aea4a202cc fix parsing of semantic template interation w/ shadowdom polyfill
port of https://github.com/Polymer/mdv/commit/05ae24466ea7b2cdd41d879169e95b00a6bf4a8e
BUG=
R=justinfagnani@google.com

Review URL: https://codereview.chromium.org//19482024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25369 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-23 21:17:34 +00:00
jmesserly@google.com 89c18e96f0 [package:mdv] port createInstance change
HTMLTemplateElement.prototype.createInstance takes model & syntaxString, sets up bindings -- https://github.com/Polymer/mdv/commit/22c32ebfa84b6e08341b2e1af71a25b5bee4b2be

R=sigmund@google.com

Review URL: https://codereview.chromium.org//18162004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24660 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-01 21:38:45 +00:00
amouravski@google.com c0a39d0412 Make html metadata follow the spec.
Per https://code.google.com/p/dart/issues/detail?id=11568

R=scheglov@google.com

Review URL: https://codereview.chromium.org//18182010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24638 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-01 18:34:30 +00:00
blois@google.com 9dd81d94a7 Fixing up DOM constructors.
This is a continuation of https://codereview.chromium.org/17063007/

Basically I changed it so factory constructors are only added if the class derives from a native type. Otherwise the native type now extends Interceptor.

BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org//18054021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24619 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-29 00:14:23 +00:00
jmesserly@google.com c326893f6a Continue updating MDV.
add OPTGROUP as an attribute template -- https://github.com/Polymer/mdv/commit/af1733d905ac96852357db5e7a78a63ba2a488fc
template ref should check treeScope.getElementById -- https://github.com/Polymer/mdv/commit/7de0697e318bb001e1649005ec48eb294edad6e4
Use correct event type for checkbox bindings -- https://github.com/Polymer/mdv/commit/2c675cab75aea2ef3d1b981a616469587b9210fe

Review URL: https://codereview.chromium.org//17917002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24562 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-27 23:30:33 +00:00
jmesserly@google.com fca7d29b2c Disallow template instances when !parentNode || !owner.defaultView https://github.com/Polymer/mdv/commit/d035acecab7c2d1afd9eb67bb01818d7ed9eb11f
extract template element from attribute templates. https://github.com/Polymer/mdv/commit/13741f22d94cec1d7ca115f023cf3a25b9245def

Note: this is based on https://codereview.chromium.org/17552019/ (reorg mdv)

R=justinfagnani@google.com

Review URL: https://codereview.chromium.org//17706003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24546 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-27 19:59:04 +00:00
jmesserly@google.com d6b9207588 Reorganize mdv and observe functionality
* keep correct dart:html APIs
* move implementation into package:mdv and package:observe
* remove dart:mdv_observe_impl
* remove getValueWorkaround/setValueWorkaround from package:observe

R=blois@google.com, floitsch@google.com, justinfagnani@google.com

Review URL: https://codereview.chromium.org//17552019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24498 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-26 23:25:47 +00:00
blois@google.com 6b44f65407 Revert "Making all DOM types abstract and removing superfluous Dartium constructors."
This reverts commit http://code.google.com/p/dart/source/detail?r=24241.

Compiler error, not sure of best fix.

BUG=

Review URL: https://codereview.chromium.org//17508002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24245 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-20 19:37:47 +00:00
blois@google.com c3547d4e9b Making all DOM types abstract and removing superfluous Dartium constructors.
Adding factory constructors to all classes to suppress missing generative constructor warnings.

Adding a throw to Dartium's base DOM class to prevent construction of native objects.

This also includes the changes necessary to make all DOM types abstract, but I'm running into a dart2js issue which is preventing that.
BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org//17063007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24241 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-20 17:31:36 +00:00
lrn@google.com faa7227cec Make new StreamController be async by default.
Change all instances, except some tests, to be sync still.
Rename Multiplex to Broadcast everywhere.

R=floitsch@google.com

Review URL: https://codereview.chromium.org//16125005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23453 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 06:07:39 +00:00
jmesserly@google.com 02ffdc01ad expose MDV addBindings
this is used to implement Web UI style bindings in the shadowroot template for declarative custom elements.

R=sigmund@google.com

Review URL: https://codereview.chromium.org//14812016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22660 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-14 03:22:00 +00:00
jmesserly@google.com 215e6e66ad Move top-level internal methods of the MDV system into a class.
In dart:html we don't have the luxury of sublibraries, so we resort to the static-methods pattern to emulate a namespace.

If there was a more appropriate class I put it there, but some methods are shared by multiple other classes.

Note, this uses another CL (https://codereview.chromium.org/14795005) as its baseline.

R=blois@google.com

Review URL: https://codereview.chromium.org//14634011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22654 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-13 22:57:45 +00:00
jmesserly@google.com 9005b278e7 Implement Model-Driven-Views spec for Dart
This has code ported from a few different sources:
* a port of https://github.com/toolkitchen/mdv polyfill
* a port of the observable layer:  https://github.com/dart-lang/web-ui/tree/master/lib/observe
* a port of list change summary: https://github.com/rafaelw/ChangeSummary/blob/master/change_summary.js

The observePath/PathObserver code is written from scratch, but inspired by change_summary. I tried to keep it simpler; it does not support dirty checking. There's no good way to do that until we get dart:mirrors.

R=floitsch@google.com, sigmund@google.com

Committed: https://code.google.com/p/dart/source/detail?r=22561

Review URL: https://codereview.chromium.org//14732003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22570 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-09 21:39:03 +00:00
jmesserly@google.com 1cef1fbc55 "Reverting 22561"
need to investigate test failures

Review URL: https://codereview.chromium.org//14908005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22562 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-09 20:43:30 +00:00
jmesserly@google.com bf4f12c62b Implement Model-Driven-Views spec for Dart
This has code ported from a few different sources:
* a port of https://github.com/toolkitchen/mdv polyfill
* a port of the observable layer:  https://github.com/dart-lang/web-ui/tree/master/lib/observe
* a port of list change summary: https://github.com/rafaelw/ChangeSummary/blob/master/change_summary.js

The observePath/PathObserver code is written from scratch, but inspired by change_summary. I tried to keep it simpler; it does not support dirty checking. There's no good way to do that until we get dart:mirrors.

R=floitsch@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org//14732003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22561 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-09 20:29:14 +00:00