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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2530243002: Crash in blink::getTypeExtension (Closed)
Patch Set: Updated test and removed extra use count after review. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 5824 matching lines...) Expand 10 before | Expand all | Expand 10 after
6531 } 6532 }
6532 6533
6533 void showLiveDocumentInstances() { 6534 void showLiveDocumentInstances() {
6534 WeakDocumentSet& set = liveDocumentSet(); 6535 WeakDocumentSet& set = liveDocumentSet();
6535 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6536 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6536 for (Document* document : set) 6537 for (Document* document : set)
6537 fprintf(stderr, "- Document %p URL: %s\n", document, 6538 fprintf(stderr, "- Document %p URL: %s\n", document,
6538 document->url().getString().utf8().data()); 6539 document->url().getString().utf8().data());
6539 } 6540 }
6540 #endif 6541 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698