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) 2000 Stefan Schimanski (1Stein@gmx.de) | 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) |
5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. | 5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 // If an object's content can't be handled and it has no fallback, let | 595 // If an object's content can't be handled and it has no fallback, let |
596 // it be handled as a plugin to show the broken plugin icon. | 596 // it be handled as a plugin to show the broken plugin icon. |
597 useFallback = objectType == ObjectContentNone && hasFallback; | 597 useFallback = objectType == ObjectContentNone && hasFallback; |
598 return objectType == ObjectContentNone || objectType == ObjectContentNetscap
ePlugin || objectType == ObjectContentOtherPlugin; | 598 return objectType == ObjectContentNone || objectType == ObjectContentNetscap
ePlugin || objectType == ObjectContentOtherPlugin; |
599 } | 599 } |
600 | 600 |
601 void HTMLPlugInElement::setPlaceholder(PassOwnPtrWillBeRawPtr<PluginPlaceholder>
placeholder) | 601 void HTMLPlugInElement::setPlaceholder(PassOwnPtrWillBeRawPtr<PluginPlaceholder>
placeholder) |
602 { | 602 { |
603 bool needsLazyReattach = (!placeholder) != (!m_placeholder); | 603 bool needsLazyReattach = (!placeholder) != (!m_placeholder); |
604 if (placeholder) { | 604 if (placeholder) { |
605 placeholder->loadIntoContainer(ensureUserAgentShadowRoot()); | 605 placeholder->loadIntoContainer(ensureClosedShadowRoot()); |
606 m_placeholder = placeholder; | 606 m_placeholder = placeholder; |
607 } else { | 607 } else { |
608 ShadowRoot& shadowRoot = ensureUserAgentShadowRoot(); | 608 ShadowRoot& shadowRoot = ensureClosedShadowRoot(); |
609 shadowRoot.removeChildren(); | 609 shadowRoot.removeChildren(); |
610 shadowRoot.appendChild(HTMLContentElement::create(document())); | 610 shadowRoot.appendChild(HTMLContentElement::create(document())); |
611 m_placeholder.clear(); | 611 m_placeholder.clear(); |
612 } | 612 } |
613 if (needsLazyReattach) | 613 if (needsLazyReattach) |
614 lazyReattachIfAttached(); | 614 lazyReattachIfAttached(); |
615 } | 615 } |
616 | 616 |
617 void HTMLPlugInElement::dispatchErrorEvent() | 617 void HTMLPlugInElement::dispatchErrorEvent() |
618 { | 618 { |
(...skipping 26 matching lines...) Expand all Loading... |
645 fastGetAttribute(HTMLNames::typeAttr); | 645 fastGetAttribute(HTMLNames::typeAttr); |
646 if (!document().contentSecurityPolicy()->allowObjectFromSource(url) | 646 if (!document().contentSecurityPolicy()->allowObjectFromSource(url) |
647 || !document().contentSecurityPolicy()->allowPluginType(mimeType, declar
edMimeType, url)) { | 647 || !document().contentSecurityPolicy()->allowPluginType(mimeType, declar
edMimeType, url)) { |
648 layoutEmbeddedObject()->setPluginUnavailabilityReason(LayoutEmbeddedObje
ct::PluginBlockedByContentSecurityPolicy); | 648 layoutEmbeddedObject()->setPluginUnavailabilityReason(LayoutEmbeddedObje
ct::PluginBlockedByContentSecurityPolicy); |
649 return false; | 649 return false; |
650 } | 650 } |
651 | 651 |
652 return !MixedContentChecker::shouldBlockFetch(frame, WebURLRequest::RequestC
ontextObject, WebURLRequest::FrameTypeNone, url); | 652 return !MixedContentChecker::shouldBlockFetch(frame, WebURLRequest::RequestC
ontextObject, WebURLRequest::FrameTypeNone, url); |
653 } | 653 } |
654 | 654 |
655 void HTMLPlugInElement::didAddUserAgentShadowRoot(ShadowRoot&) | 655 void HTMLPlugInElement::didAddClosedShadowRoot(ShadowRoot&) |
656 { | 656 { |
657 userAgentShadowRoot()->appendChild(HTMLContentElement::create(document())); | 657 closedShadowRoot()->appendChild(HTMLContentElement::create(document())); |
658 } | 658 } |
659 | 659 |
660 void HTMLPlugInElement::willAddFirstAuthorShadowRoot() | 660 void HTMLPlugInElement::willAddFirstOpenShadowRoot() |
661 { | 661 { |
662 lazyReattachIfAttached(); | 662 lazyReattachIfAttached(); |
663 } | 663 } |
664 | 664 |
665 bool HTMLPlugInElement::hasFallbackContent() const | 665 bool HTMLPlugInElement::hasFallbackContent() const |
666 { | 666 { |
667 return false; | 667 return false; |
668 } | 668 } |
669 | 669 |
670 bool HTMLPlugInElement::useFallbackContent() const | 670 bool HTMLPlugInElement::useFallbackContent() const |
671 { | 671 { |
672 return hasAuthorShadowRoot(); | 672 return hasOpenShadowRoot(); |
673 } | 673 } |
674 | 674 |
675 void HTMLPlugInElement::lazyReattachIfNeeded() | 675 void HTMLPlugInElement::lazyReattachIfNeeded() |
676 { | 676 { |
677 if (!useFallbackContent() && !usePlaceholderContent() && needsWidgetUpdate()
&& renderer() && !isImageType()) | 677 if (!useFallbackContent() && !usePlaceholderContent() && needsWidgetUpdate()
&& renderer() && !isImageType()) |
678 lazyReattachIfAttached(); | 678 lazyReattachIfAttached(); |
679 } | 679 } |
680 | 680 |
681 } | 681 } |
OLD | NEW |