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 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 UseCounter::count(document, | 683 UseCounter::count(document, |
684 UseCounter::DocumentCreateElement2ndArgStringHandling); | 684 UseCounter::DocumentCreateElement2ndArgStringHandling); |
685 return stringOrOptions.getAsString(); | 685 return stringOrOptions.getAsString(); |
686 } | 686 } |
687 | 687 |
688 if (stringOrOptions.isDictionary()) { | 688 if (stringOrOptions.isDictionary()) { |
689 Dictionary dict = stringOrOptions.getAsDictionary(); | 689 Dictionary dict = stringOrOptions.getAsDictionary(); |
690 ElementCreationOptions impl; | 690 ElementCreationOptions impl; |
691 V8ElementCreationOptions::toImpl(dict.isolate(), dict.v8Value(), impl, | 691 V8ElementCreationOptions::toImpl(dict.isolate(), dict.v8Value(), impl, |
692 exceptionState); | 692 exceptionState); |
| 693 if (exceptionState.hadException()) |
| 694 return emptyString; |
| 695 |
693 if (impl.hasIs()) | 696 if (impl.hasIs()) |
694 return impl.is(); | 697 return impl.is(); |
695 | |
696 return toCoreString(dict.v8Value()->ToString()); | |
697 } | 698 } |
698 | 699 |
699 return emptyString; | 700 return emptyString; |
700 } | 701 } |
701 | 702 |
702 // https://dom.spec.whatwg.org/#dom-document-createelement | 703 // https://dom.spec.whatwg.org/#dom-document-createelement |
703 Element* Document::createElement(const AtomicString& localName, | 704 Element* Document::createElement(const AtomicString& localName, |
704 const StringOrDictionary& stringOrOptions, | 705 const StringOrDictionary& stringOrOptions, |
705 ExceptionState& exceptionState) { | 706 ExceptionState& exceptionState) { |
706 // 1. If localName does not match Name production, throw InvalidCharacterError | 707 // 1. If localName does not match Name production, throw InvalidCharacterError |
(...skipping 5862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6569 } | 6570 } |
6570 | 6571 |
6571 void showLiveDocumentInstances() { | 6572 void showLiveDocumentInstances() { |
6572 WeakDocumentSet& set = liveDocumentSet(); | 6573 WeakDocumentSet& set = liveDocumentSet(); |
6573 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6574 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6574 for (blink::Document* document : set) | 6575 for (blink::Document* document : set) |
6575 fprintf(stderr, "- Document %p URL: %s\n", document, | 6576 fprintf(stderr, "- Document %p URL: %s\n", document, |
6576 document->url().getString().utf8().data()); | 6577 document->url().getString().utf8().data()); |
6577 } | 6578 } |
6578 #endif | 6579 #endif |
OLD | NEW |