| 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 4908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4919 } | 4919 } |
| 4920 | 4920 |
| 4921 // Support for Javascript execCommand, and related methods | 4921 // Support for Javascript execCommand, and related methods |
| 4922 | 4922 |
| 4923 static Editor::Command command(Document* document, const String& commandName) { | 4923 static Editor::Command command(Document* document, const String& commandName) { |
| 4924 LocalFrame* frame = document->frame(); | 4924 LocalFrame* frame = document->frame(); |
| 4925 if (!frame || frame->document() != document) | 4925 if (!frame || frame->document() != document) |
| 4926 return Editor::Command(); | 4926 return Editor::Command(); |
| 4927 | 4927 |
| 4928 document->updateStyleAndLayoutTree(); | 4928 document->updateStyleAndLayoutTree(); |
| 4929 return frame->editor().createCommand(commandName, CommandFromDOM); | 4929 return frame->editor().createCommandFromDOM(commandName); |
| 4930 } | 4930 } |
| 4931 | 4931 |
| 4932 bool Document::execCommand(const String& commandName, | 4932 bool Document::execCommand(const String& commandName, |
| 4933 bool, | 4933 bool, |
| 4934 const String& value, | 4934 const String& value, |
| 4935 ExceptionState& exceptionState) { | 4935 ExceptionState& exceptionState) { |
| 4936 if (!isHTMLDocument() && !isXHTMLDocument()) { | 4936 if (!isHTMLDocument() && !isXHTMLDocument()) { |
| 4937 exceptionState.throwDOMException( | 4937 exceptionState.throwDOMException( |
| 4938 InvalidStateError, "execCommand is only supported on HTML documents."); | 4938 InvalidStateError, "execCommand is only supported on HTML documents."); |
| 4939 return false; | 4939 return false; |
| (...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6543 } | 6543 } |
| 6544 | 6544 |
| 6545 void showLiveDocumentInstances() { | 6545 void showLiveDocumentInstances() { |
| 6546 WeakDocumentSet& set = liveDocumentSet(); | 6546 WeakDocumentSet& set = liveDocumentSet(); |
| 6547 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6547 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6548 for (Document* document : set) | 6548 for (Document* document : set) |
| 6549 fprintf(stderr, "- Document %p URL: %s\n", document, | 6549 fprintf(stderr, "- Document %p URL: %s\n", document, |
| 6550 document->url().getString().utf8().data()); | 6550 document->url().getString().utf8().data()); |
| 6551 } | 6551 } |
| 6552 #endif | 6552 #endif |
| OLD | NEW |