Commit Graph

29 Commits

Author SHA1 Message Date
Jeff Gilbert
70a22b2878 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Boris Zbarsky
8324aa1fa8 Bug 1444909 part 2. Change DOMTokenList.replace() to return a boolean and pull in the corresponding web platform test updates. r=qdot
The wpt changes come from https://github.com/w3c/web-platform-tests/pull/9920
and are needed to keep Element-classlist.html passing.

The change to testing/web-platform/mozilla/tests/dom/classList.html is pulling
those changes into our weird forked version of that test...

MozReview-Commit-ID: CvQlBRuieUY
2018-03-14 16:08:58 -04:00
Boris Zbarsky
138a434930 Bug 1444909 part 1. Fix DOMTokenList.replace() to not do the attr set when the old token was not found. r=qdot
This fixes upcoming tests that will check when we actually mutate the attribute.

MozReview-Commit-ID: 7r5ErK9wvir
2018-03-14 16:08:58 -04:00
Edgar Chen
d9444e4dd3 Bug 1422197 - Add fast path to get DocGroup in binding code for [CEReactions]; r=smaug
MozReview-Commit-ID: HgbFo9ddr0o
2017-11-27 16:10:27 +08:00
Xidorn Quan
7f2b01ffd0 Bug 1407843 part 1 - Introduce a global-level AtomArray type alias. r=froydnj
MozReview-Commit-ID: DbGkWxkPfX7
2017-10-13 11:59:23 +11:00
Nicholas Nethercote
7dbfdaf890 Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP
2017-10-03 09:05:19 +11:00
Olli Pettay
848e212645 Backout bug 1359780 because it causes bug 1360230, r=backout 2017-04-27 20:50:21 +03:00
Aryeh Gregor
21eeaf2a81 Bug 1359780 - Always remove duplicates/whitespace in DOMTokenList methods r=masayuki
Previously, replace() and toggle() would not always remove duplicates
and whitespace from the DOM attribute in the case where they were no-ops
(replacing a nonexistent token, force-toggling a token to its current
state).  Now they do.  This matches the behavior of add() and remove(),
and also replace() in one case (replacing an existing token with
itself).

This follows a spec change: https://github.com/whatwg/dom/pull/444

MozReview-Commit-ID: 7lDEQxOGxPV
2017-04-26 15:13:44 +03:00
Aryeh Gregor
6218cacf33 Bug 869788 - Normalize DOMTokenList for whitespace/dupes; r=smaug
Some bits taken from a patch by Cameron McCormack.  This follows a
change to the DOM spec that has already been implemented by WebKit.

We do no checks for duplicates on initial attribute parsing, only when
the DOMTokenList is accessed.  We re-check for duplicates on every
DOMTokenList access, but optimized with a bloom filter, so it should be
fast.  It would be possible to add a flag to check if we've already
removed duplicates from the atom list, but it would require the
nsAttrValue to talk to the nsDOMTokenList somehow, and a spare bit would
be needed in nsAttrValue, and it would only help cases where
DOMTokenList is repeatedly accessed without the content attribute being
modified in between (e.g., .length) where the token list is extremely
long.

This patch assumes that no one other than nsDOMTokenList cares if
duplicates are removed from the nsAttrValue's atom array.  If anything
does, they will see inconsistent behavior depending on whether
nsDOMTokenList has removed duplicates yet.  Since we don't want to
check for duplicates on parse for performance reasons, the correct fix
is to update the code elsewhere to also remove duplicates.

MozReview-Commit-ID: 97KRVhPGwm8
2016-04-11 18:01:14 +03:00
Emilio Cobos Álvarez
67c19a4605 Bug 1293563: Simplify DOMTokenlist.remove using a tokenizer. r=baku
MozReview-Commit-ID: 4TTprZaZg8l
2016-08-26 22:27:14 -07:00
Emilio Cobos Álvarez
ef910caad3 Bug 1293563: Fix some DOMTokenList.replace bugs. r=baku
MozReview-Commit-ID: C2tCbHmwsi6
2016-08-08 22:48:30 -07:00
Ben Tian
244567c7ce Bug 1263116 - Stop throwing for DOMTokenList's.contains() when using empty string or ASCII whitespace, r=baku 2016-05-05 18:07:22 +08:00
Boris Zbarsky
7243aac6bf Bug 1257849 part 5. Implement DOMTokenList.prototype.supports(). r=bkelly 2016-05-04 23:41:25 -04:00
Boris Zbarsky
5ea2e6dc2b Bug 1257849 part 1. Add a concept of supported tokens to nsDOMTokenList. r=bkelly 2016-05-04 23:41:24 -04:00
Emilio Cobos Álvarez
43d463e550 Bug 1224186: Implement DOMTokenlist.replace r=baku,Ms2ger 2016-04-28 11:20:25 +02:00
Carsten "Tomcat" Book
703994ffed Backed out changeset 0eb8cf4e5b92 (bug 1224186) for w2 wpt test issues on a CLOSED TREE 2016-04-14 15:53:52 +02:00
Emilio Cobos Álvarez
9e6c01ff20 Bug 1224186 - Implement DOMTokenlist.replace r=baku r=Ms2ger 2016-04-13 08:49:00 +02:00
Carsten "Tomcat" Book
b7494546e1 Backed out changeset 92a78fabeb8d (bug 1224186) for causing issues in /dom/interfaces.html 2016-04-13 15:09:26 +02:00
Emilio Cobos Álvarez
e7729bf5d6 Bug 1224186: Implement DOMTokenlist.replace r=baku r=Ms2ger 2016-03-21 06:10:00 +01:00
Deepthi Venkitaramanan
b00793a3d8 Bug 1244328 - Merge the functionality of DOMSettableTokenList into DOMTokenList and make everything that used to refer to DOMSettableTokenList refer to DOMTokenList instead. r=bzbarsky 2016-02-11 17:50:42 -05:00
Birunthan Mohanathas
bfee0fb40c Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-02-02 17:36:30 +02:00
Phil Ringnalda
d871b9515f Back out 7 changesets (bug 1235261) for cpptest failures in TestTArray
CLOSED TREE

Backed out changeset d66c3f19a210 (bug 1235261)
Backed out changeset 467d945426bb (bug 1235261)
Backed out changeset 32b61df13142 (bug 1235261)
Backed out changeset c50bb8ed4196 (bug 1235261)
Backed out changeset 0ff0fa6fe81f (bug 1235261)
Backed out changeset df70e89669da (bug 1235261)
Backed out changeset 064969357fc9 (bug 1235261)
2016-01-31 10:10:57 -08:00
Birunthan Mohanathas
245cd6a02f Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-01-31 17:12:12 +02:00
Andrew McCreight
92010d3e4c Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Boris Zbarsky
3a822d99b4 Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp.  The
rest of this diff was generated by running the following commands:

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 10:13:33 -04:00
Nicholas Nethercote
0247de46d8 Bug 1127201 (attempt 2, part 1) - Replace most NS_ABORT_IF_FALSE calls with MOZ_ASSERT. r=Waldo. 2015-02-09 14:34:50 -08:00
Andrew McCreight
e048a7df33 Back out Bug 1127201 (part 2) for various problems. 2015-02-06 15:04:32 -08:00
Nicholas Nethercote
40ab0270d5 Bug 1127201 (part 2) - Convert all NS_ABORT_IF_FALSE calls to MOZ_ASSERT. r=Waldo. 2015-02-04 20:05:36 -08:00
Birunthan Mohanathas
e9068bbc4f Bug 946065 - Part 12: Move content/base/ to dom/ and flatten subdirectories. r=peterv 2014-10-25 20:25:22 +03:00