Commit Graph

91 Commits

Author SHA1 Message Date
efortuna@google.com 502c7c29c8 Allow matchingTarget to also include the currentTarget.
BUG=
R=blois@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29609 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 23:32:39 +00:00
blois@google.com 358392883c Adding ElementEventStream.capture
Also making Element.on[] return an ElementStream.

BUG=13214
R=efortuna@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28819 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-17 20:19:46 +00:00
blois@google.com a86bee09de Fix for events not firing on sanitized elements
Issue was that the events weren't being raised when the elements were in documents without views.

BUG=14184
R=efortuna@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28817 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-17 19:58:14 +00:00
efortuna@google.com a8f1004971 Add "matchingTarget" function to Event, which is the Element that matched the CSS value selector.
Bug fix for https://code.google.com/p/dart/issues/detail?id=12931

BUG=
R=blois@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28430 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-09 23:43:20 +00:00
efortuna@google.com eaa854b258 Move Rectangle and Point into dart:math.
BUG=
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28272 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-04 17:47:39 +00:00
efortuna@google.com 0b53b15b7d "Reverting 28184"
TBR=blois

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28186 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-02 22:13:16 +00:00
efortuna@google.com 837c6b6ee3 Move Point and Rect over to dart:math, to be re-exported by dart:html.
BUG=
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28184 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-02 21:54:02 +00:00
blois@google.com c47eae035f Fixing createFragment on IE9 Table elements
Basically IE9 does not support innerHTML on table elements, so need to go one level up and wrap everything in a <table> tag.

Another issue is that IE9 does not support creating body elements or the matches call when the element is not in the document, updated the test to account for these.

BUG=12830
R=jmesserly@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26806 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 18:03:12 +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
efortuna@google.com 8963a49505 Event delegation
Fix for https://code.google.com/p/dart/issues/detail?id=6270

BUG=
R=blois@google.com, jmesserly@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25969 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-09 17:37:32 +00:00
efortuna@google.com bf91aab6f1 Make element offset test machine independent.
BUG=
R=jmesserly@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25526 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-26 17:47:34 +00:00
efortuna@google.com dd35aa0aaf Disable offset test until it is reproducible across machines.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25490 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-25 18:49:14 +00:00
efortuna@google.com e74c7fabd4 Adjust element offset Test for IE.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25488 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-25 18:44:37 +00:00
efortuna@google.com fbe134389b Added offset document measurement to Element.
BUG=
R=jmesserly@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25483 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-25 17:45:39 +00:00
efortuna@google.com 533a66bdac Reapply removeWhere and retainWhere for elements in dart:html
BUG=
R=blois@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23371 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 23:40:52 +00:00
efortuna@google.com 54bafa2ebf "Reverting 23366"
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23369 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 22:25:05 +00:00
efortuna@google.com 942392b7e6 Correctly implemented removeWhere and retainWhere for elements in dart:html.
BUG=
R=blois@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23366 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 21:22:22 +00:00
blois@google.com 59c2920a7f This is a resubmit of:
https://codereview.chromium.org/13852008/

There were some type issues in Dartium checked mode on collections which caused problems. Basically just tweaked the generic arguments on some collections.

BUG=
R=sra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22087 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-26 21:10:49 +00:00
blois@google.com 463e990434 Revert "With the collections deriving from ListBase, we no longer need to implement a number of boiler-plate methods."
This reverts commit http://code.google.com/p/dart/source/detail?r=21848.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21852 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-22 22:54:33 +00:00
blois@google.com 3dc436c463 With the collections deriving from ListBase, we no longer need to implement a number of boiler-plate methods.
There are some gotchas with Element and Node lists as they may mutate the list being passed in if it's a nodelist as well, so I'm keeping those unimplemented.

In some cases this may fall back to less efficient operations (such as the WrappedList which no longer forwards every method), but I tried to keep all of the primary cases fast and I believe that these methods would fall back to generic implementations anyways in all cases where we use the classes.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21848 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-22 22:29:05 +00:00
floitsch@google.com 759a366cea Remove insertRange.
Review URL: https://codereview.chromium.org//13956006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21464 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 15:20:16 +00:00
efortuna@google.com 5c0ae732b4 Add back localName and improve toString for Html nodes.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21105 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-08 19:29:10 +00:00
efortuna@google.com a46b113afd Make html lists print a nice toString method.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21010 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 23:53:35 +00:00
blois@google.com 139b774130 Narrowing attribute maps to only accept strings.
Previously they could accept any value and would convert to a string, but it's not incredibly useful and potentially confusing.

BUG=8191

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20352 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-21 21:07:56 +00:00
blois@google.com 1fa1a541df Adding tests for Element & Node lists insert method.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20129 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-15 23:58:06 +00:00
lrn@google.com 844cd39fad Change getRange to sublist. Make getRange deprecated.
This changes the exception behavior of getRange. It used to accept
a length of zero, no matter what start value. Now the start value
must be a valid list index.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20064 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-15 09:15:39 +00:00
blois@google.com df12fc3a5f Converting Element.client*, offset* and Screen.avail* over to Rects
Converting more APIs over to exposing as Rects.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19702 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-08 18:12:16 +00:00
blois@google.com 2fcae75253 Exposing Point & Rect types
This exposes ClientRects as Rects and exposes UIEvent.clientX/Y properties as Points.

This also deprecates the UIEvent.clientX/Y properties.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19659 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-07 22:17:04 +00:00
blois@google.com a94084913c Fixing a number of dart:html analyzer issues
A couple of real bugs, rotten code and deprecated APIs.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19588 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-06 22:46:34 +00:00
lrn@google.com 03f5a66836 Recommit changing List.skip/take/revert returns Iterable and remove mappedBy.
This reverts r18591.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18615 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-18 10:35:51 +00:00
rnystrom@google.com 0e0473d33a Unbreak pub:
Revert "Make List.skip, List.take and List.reversed return Iterables, not Lists."

This reverts commit 44c3745a76acfad3d1d5bfc7a8b8c8e2def30e09.

Revert "Remove deprecated mappedBy."

This reverts commit 779ab69eab73e5e349245e99560b18955908e0cc.

BUG=dartbug.com/8560

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18591 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-15 18:38:42 +00:00
floitsch@google.com 0672317bec Remove deprecated mappedBy.
Committed: https://code.google.com/p/dart/source/detail?r=18575
Reverted: http://code.google.com/p/dart/source/detail?r=18576

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18579 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-15 13:57:18 +00:00
floitsch@google.com ad839e6957 Revert "Remove deprecated mappedBy."
This reverts commit 18575.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18576 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-15 13:23:22 +00:00
floitsch@google.com b37100770b Remove deprecated mappedBy.
Review URL: https://codereview.chromium.org//12212213

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18575 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-15 13:18:17 +00:00
blois@google.com 432aa0994c Renaming Element.dataAttributes to Element.dataset.
Element.dataset is the DOM version of the API, so we should have ours named the same.

Opened bug #8545 that we should optimize Element.dataset to use the native functionality if present.

BUG=5963

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18533 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-14 19:12:38 +00:00
blois@google.com b4fa823142 Updating Element.scrollIntoView to be platform independent.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18498 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-14 00:40:03 +00:00
blois@google.com 5fbee6d62f Fixes for TransitionEvent changes.
Two changes-
Removed the extends clause for _WebKitTransitionEvent which caused an issues with dartc.
Platform-independent changes for firing the event broke element_test on non-Chrome browsers. This test is actually quite useless.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18278 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-08 21:47:49 +00:00
lrn@google.com 9b23dff467 Reapply "Rename mappedBy to map."
This reverts commit r17907.

TBR.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17918 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-31 15:12:56 +00:00
floitsch@google.com b1a118d5ce Revert "Rename mappedBy to map."
This reverts commit 17899.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17907 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-31 14:02:27 +00:00
lrn@google.com 0dc2f4b1ba Rename mappedBy to map.
Retain a deprecated mappedBy for now.
Change return type of mappedBy, skip and take on List to Iterable.

BUG= http://dartbug.com/8063
BUG= http://dartbug.com/8064
BUG= http://dartbug.com/6739
BUG= http://dartbug.com/7982

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17899 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-31 12:37:13 +00:00
blois@google.com f46672cb73 Converting tests over to using event streams.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17735 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-28 23:31:15 +00:00
blois@google.com af77086f8a Fixing element_test on Safari.
I changed computedStyle to getComputedStyle, but forgot this location.

But this test was not in a group, which with the individual config should have made the test not execute. But on Safari it's failing all of the element_test tests.

Odd thing is that it's not failing on the rest of the browsers.

Also adding a small delay for the setTimeout case as IE appears to be optimizing the 0 condition (in some cases).

TBR
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17683 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-26 01:42:29 +00:00
blois@google.com ef8128536a Revert "Adding supported checks for Element.matches."
This reverts commit 17670 which is causing problems for IE9.

For some reason IE9 is failing the matches test but passing the supported check. But I cannot repro on my machine.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17678 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-26 00:34:25 +00:00
blois@google.com 7936da179e Adding supported checks for Element.matches.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17670 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-25 23:29:05 +00:00
jmesserly@google.com ab1536427a Fix new Element.html with tables in IE
http://dartbug.com/7902

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17104 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-15 23:17:34 +00:00
blois@google.com 12dbb6aa18 Fixing Element.matches to be cross-platform and follow latest spec.
BUG=4401

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16829 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-09 01:30:44 +00:00
whesse@google.com 8b5189bc81 Fix some failures in html/element_test by changing where(...)[0] to where(...).first.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16707 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-07 15:12:30 +00:00