Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
| 7 * rights reserved. | 7 * rights reserved. |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 682 UseCounter::count(document, | 682 UseCounter::count(document, |
| 683 UseCounter::DocumentCreateElement2ndArgStringHandling); | 683 UseCounter::DocumentCreateElement2ndArgStringHandling); |
| 684 return stringOrOptions.getAsString(); | 684 return stringOrOptions.getAsString(); |
| 685 } | 685 } |
| 686 | 686 |
| 687 if (stringOrOptions.isDictionary()) { | 687 if (stringOrOptions.isDictionary()) { |
| 688 Dictionary dict = stringOrOptions.getAsDictionary(); | 688 Dictionary dict = stringOrOptions.getAsDictionary(); |
| 689 ElementCreationOptions impl; | 689 ElementCreationOptions impl; |
| 690 V8ElementCreationOptions::toImpl(dict.isolate(), dict.v8Value(), impl, | 690 V8ElementCreationOptions::toImpl(dict.isolate(), dict.v8Value(), impl, |
| 691 exceptionState); | 691 exceptionState); |
| 692 if (exceptionState.hadException()) | |
| 693 return emptyString(); | |
| 694 | |
| 692 if (impl.hasIs()) | 695 if (impl.hasIs()) |
| 693 return impl.is(); | 696 return impl.is(); |
| 694 | 697 |
| 695 return toCoreString(dict.v8Value()->ToString()); | 698 // Do not handle stringification, but count it as a string handling |
|
dominicc (has gone to gerrit)
2017/01/19 05:34:46
This changes behavior because we won't toString th
Anton Obzhirov
2017/01/19 16:45:44
I think no need to count this case it should be ve
| |
| 699 UseCounter::count(document, | |
| 700 UseCounter::DocumentCreateElement2ndArgStringHandling); | |
| 696 } | 701 } |
| 697 | 702 |
| 698 return emptyString(); | 703 return emptyString(); |
| 699 } | 704 } |
| 700 | 705 |
| 701 // https://dom.spec.whatwg.org/#dom-document-createelement | 706 // https://dom.spec.whatwg.org/#dom-document-createelement |
| 702 Element* Document::createElement(const AtomicString& localName, | 707 Element* Document::createElement(const AtomicString& localName, |
| 703 const StringOrDictionary& stringOrOptions, | 708 const StringOrDictionary& stringOrOptions, |
| 704 ExceptionState& exceptionState) { | 709 ExceptionState& exceptionState) { |
| 705 // 1. If localName does not match Name production, throw InvalidCharacterError | 710 // 1. If localName does not match Name production, throw InvalidCharacterError |
| (...skipping 5882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6588 } | 6593 } |
| 6589 | 6594 |
| 6590 void showLiveDocumentInstances() { | 6595 void showLiveDocumentInstances() { |
| 6591 WeakDocumentSet& set = liveDocumentSet(); | 6596 WeakDocumentSet& set = liveDocumentSet(); |
| 6592 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6597 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6593 for (Document* document : set) | 6598 for (Document* document : set) |
| 6594 fprintf(stderr, "- Document %p URL: %s\n", document, | 6599 fprintf(stderr, "- Document %p URL: %s\n", document, |
| 6595 document->url().getString().utf8().data()); | 6600 document->url().getString().utf8().data()); |
| 6596 } | 6601 } |
| 6597 #endif | 6602 #endif |
| OLD | NEW |