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 4938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4949 } | 4949 } |
4950 | 4950 |
4951 // Support for Javascript execCommand, and related methods | 4951 // Support for Javascript execCommand, and related methods |
4952 | 4952 |
4953 static Editor::Command command(Document* document, const String& commandName) { | 4953 static Editor::Command command(Document* document, const String& commandName) { |
4954 LocalFrame* frame = document->frame(); | 4954 LocalFrame* frame = document->frame(); |
4955 if (!frame || frame->document() != document) | 4955 if (!frame || frame->document() != document) |
4956 return Editor::Command(); | 4956 return Editor::Command(); |
4957 | 4957 |
4958 document->updateStyleAndLayoutTree(); | 4958 document->updateStyleAndLayoutTree(); |
4959 return frame->editor().createCommand(commandName, CommandFromDOM); | 4959 return frame->editor().createCommandFromDOM(commandName); |
4960 } | 4960 } |
4961 | 4961 |
4962 bool Document::execCommand(const String& commandName, | 4962 bool Document::execCommand(const String& commandName, |
4963 bool, | 4963 bool, |
4964 const String& value, | 4964 const String& value, |
4965 ExceptionState& exceptionState) { | 4965 ExceptionState& exceptionState) { |
4966 if (!isHTMLDocument() && !isXHTMLDocument()) { | 4966 if (!isHTMLDocument() && !isXHTMLDocument()) { |
4967 exceptionState.throwDOMException( | 4967 exceptionState.throwDOMException( |
4968 InvalidStateError, "execCommand is only supported on HTML documents."); | 4968 InvalidStateError, "execCommand is only supported on HTML documents."); |
4969 return false; | 4969 return false; |
(...skipping 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6572 } | 6572 } |
6573 | 6573 |
6574 void showLiveDocumentInstances() { | 6574 void showLiveDocumentInstances() { |
6575 WeakDocumentSet& set = liveDocumentSet(); | 6575 WeakDocumentSet& set = liveDocumentSet(); |
6576 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6576 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6577 for (Document* document : set) | 6577 for (Document* document : set) |
6578 fprintf(stderr, "- Document %p URL: %s\n", document, | 6578 fprintf(stderr, "- Document %p URL: %s\n", document, |
6579 document->url().getString().utf8().data()); | 6579 document->url().getString().utf8().data()); |
6580 } | 6580 } |
6581 #endif | 6581 #endif |
OLD | NEW |