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 r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. |
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 element = registrationContext()->createCustomTagElement(*this, qName); | 801 element = registrationContext()->createCustomTagElement(*this, qName); |
802 else | 802 else |
803 element = createElement(qName, false); | 803 element = createElement(qName, false); |
804 | 804 |
805 if (!typeExtension.isEmpty()) | 805 if (!typeExtension.isEmpty()) |
806 CustomElementRegistrationContext::setIsAttributeAndTypeExtension(element
.get(), typeExtension); | 806 CustomElementRegistrationContext::setIsAttributeAndTypeExtension(element
.get(), typeExtension); |
807 | 807 |
808 return element.release(); | 808 return element.release(); |
809 } | 809 } |
810 | 810 |
811 ScriptValue Document::registerElement(ScriptState* scriptState, const AtomicStri
ng& name, ExceptionState& exceptionState) | |
812 { | |
813 ElementRegistrationOptions options; | |
814 return registerElement(scriptState, name, options, exceptionState); | |
815 } | |
816 | |
817 ScriptValue Document::registerElement(ScriptState* scriptState, const AtomicStri
ng& name, const ElementRegistrationOptions& options, ExceptionState& exceptionSt
ate, CustomElement::NameSet validNames) | 811 ScriptValue Document::registerElement(ScriptState* scriptState, const AtomicStri
ng& name, const ElementRegistrationOptions& options, ExceptionState& exceptionSt
ate, CustomElement::NameSet validNames) |
818 { | 812 { |
819 if (!registrationContext()) { | 813 if (!registrationContext()) { |
820 exceptionState.throwDOMException(NotSupportedError, "No element registra
tion context is available."); | 814 exceptionState.throwDOMException(NotSupportedError, "No element registra
tion context is available."); |
821 return ScriptValue(); | 815 return ScriptValue(); |
822 } | 816 } |
823 | 817 |
824 CustomElementConstructorBuilder constructorBuilder(scriptState, options); | 818 CustomElementConstructorBuilder constructorBuilder(scriptState, options); |
825 registrationContext()->registerElement(this, &constructorBuilder, name, vali
dNames, exceptionState); | 819 registrationContext()->registerElement(this, &constructorBuilder, name, vali
dNames, exceptionState); |
826 return constructorBuilder.bindingsReturnValue(); | 820 return constructorBuilder.bindingsReturnValue(); |
(...skipping 3526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4353 m_designMode = value; | 4347 m_designMode = value; |
4354 for (Frame* frame = m_frame; frame; frame = frame->tree().traverseNext(m_fra
me)) { | 4348 for (Frame* frame = m_frame; frame; frame = frame->tree().traverseNext(m_fra
me)) { |
4355 if (!frame->isLocalFrame()) | 4349 if (!frame->isLocalFrame()) |
4356 continue; | 4350 continue; |
4357 if (!toLocalFrame(frame)->document()) | 4351 if (!toLocalFrame(frame)->document()) |
4358 break; | 4352 break; |
4359 toLocalFrame(frame)->document()->setNeedsStyleRecalc(SubtreeStyleChange,
StyleChangeReasonForTracing::create(StyleChangeReason::DesignMode)); | 4353 toLocalFrame(frame)->document()->setNeedsStyleRecalc(SubtreeStyleChange,
StyleChangeReasonForTracing::create(StyleChangeReason::DesignMode)); |
4360 } | 4354 } |
4361 } | 4355 } |
4362 | 4356 |
4363 Document::InheritedBool Document::getDesignMode() const | |
4364 { | |
4365 return m_designMode; | |
4366 } | |
4367 | |
4368 bool Document::inDesignMode() const | 4357 bool Document::inDesignMode() const |
4369 { | 4358 { |
4370 for (const Document* d = this; d; d = d->parentDocument()) { | 4359 for (const Document* d = this; d; d = d->parentDocument()) { |
4371 if (d->m_designMode != inherit) | 4360 if (d->m_designMode != inherit) |
4372 return d->m_designMode; | 4361 return d->m_designMode; |
4373 } | 4362 } |
4374 return false; | 4363 return false; |
4375 } | 4364 } |
4376 | 4365 |
4377 String Document::designMode() const | 4366 String Document::designMode() const |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5165 DocumentLoader* loader = m_frame->loader().documentLoader(); | 5154 DocumentLoader* loader = m_frame->loader().documentLoader(); |
5166 if (!loader) | 5155 if (!loader) |
5167 return 0; | 5156 return 0; |
5168 | 5157 |
5169 if (m_frame->document() != this) | 5158 if (m_frame->document() != this) |
5170 return 0; | 5159 return 0; |
5171 | 5160 |
5172 return loader; | 5161 return loader; |
5173 } | 5162 } |
5174 | 5163 |
5175 IntSize Document::initialViewportSize() const | |
5176 { | |
5177 if (!view()) | |
5178 return IntSize(); | |
5179 return view()->unscaledVisibleContentSize(IncludeScrollbars); | |
5180 } | |
5181 | |
5182 Node* eventTargetNodeForDocument(Document* doc) | 5164 Node* eventTargetNodeForDocument(Document* doc) |
5183 { | 5165 { |
5184 if (!doc) | 5166 if (!doc) |
5185 return 0; | 5167 return 0; |
5186 Node* node = doc->focusedElement(); | 5168 Node* node = doc->focusedElement(); |
5187 if (!node && doc->isPluginDocument()) { | 5169 if (!node && doc->isPluginDocument()) { |
5188 PluginDocument* pluginDocument = toPluginDocument(doc); | 5170 PluginDocument* pluginDocument = toPluginDocument(doc); |
5189 node = pluginDocument->pluginNode(); | 5171 node = pluginDocument->pluginNode(); |
5190 } | 5172 } |
5191 if (!node && doc->isHTMLDocument()) | 5173 if (!node && doc->isHTMLDocument()) |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5759 #ifndef NDEBUG | 5741 #ifndef NDEBUG |
5760 using namespace blink; | 5742 using namespace blink; |
5761 void showLiveDocumentInstances() | 5743 void showLiveDocumentInstances() |
5762 { | 5744 { |
5763 WeakDocumentSet& set = liveDocumentSet(); | 5745 WeakDocumentSet& set = liveDocumentSet(); |
5764 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5746 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
5765 for (Document* document : set) | 5747 for (Document* document : set) |
5766 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); | 5748 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); |
5767 } | 5749 } |
5768 #endif | 5750 #endif |
OLD | NEW |