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

Issue 10005017: Support DOMStringMap in generators. (Closed)

Created:
8 years, 8 months ago by Anton Muhin
Modified:
8 years, 8 months ago
Reviewers:
podivilov, sra1
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -4 lines) Patch
M lib/dom/scripts/generator.py View 2 chunks +10 lines, -4 lines 2 comments Download

Messages

Total messages: 4 (0 generated)
Anton Muhin
8 years, 8 months ago (2012-04-05 19:33:00 UTC) #1
podivilov
lgtm
8 years, 8 months ago (2012-04-06 12:05:40 UTC) #2
sra1
https://chromiumcodereview.appspot.com/10005017/diff/1/lib/dom/scripts/generator.py File lib/dom/scripts/generator.py (right): https://chromiumcodereview.appspot.com/10005017/diff/1/lib/dom/scripts/generator.py#newcode20 lib/dom/scripts/generator.py:20: 'DOMStringMap': 'Map<String, String>', We can't do this. There is ...
8 years, 8 months ago (2012-04-06 18:23:39 UTC) #3
Anton Muhin
8 years, 8 months ago (2012-04-09 09:50:51 UTC) #4
https://chromiumcodereview.appspot.com/10005017/diff/1/lib/dom/scripts/genera...
File lib/dom/scripts/generator.py (right):

https://chromiumcodereview.appspot.com/10005017/diff/1/lib/dom/scripts/genera...
lib/dom/scripts/generator.py:20: 'DOMStringMap': 'Map<String, String>',
On 2012/04/06 18:23:39, sra1 wrote:
> We can't do this.

No, we can :)

> There is a DOMStringMap type.

No, as of now there are none.  As there was no dataset attribute on Element
interface---this line is necessary to make us generate dataset attribute if we
remove DOMStringMap interface as we do now.

> In the JavaScript world, element.dataset returns an object that satisfies  (x
> instanceof DOMStringMap).
> DOMStringMap should *implement* Map<String, String>.
> 
> An interface method / getter may returning DOMStringMap may widen to
> Map<String,String> but the implementation class (in the frog code) absolutely
> must have the correct implementation type.

No doubt about that.

> DOMStringMap is magical - 
> element.dataset['foo'] = bar
> modifies the element to add a data-foo attribute.

That's NodeList's level of magic.

> DOMStringList also needs to be handled correctly.

No doubt about that as well.

> When we access IDBDatabase.objectStoreNames we get a DOMStringList which needs
> to implement List<String>
> There are two differences:
> 1. DOMStringList is immutable so no magical behaviour
> 2. DOMStringList is also an input (e.g. to IDBDatabase.transaction), so this
> needs to work:
> 
>     mydatabase.transaction(mydatabase.objectStoreNames, ...)
> 

Absolutely, I even already have a todo for that in Dartium code.

Powered by Google App Engine
This is Rietveld 408576698