Commit c8ad3918 authored by deepak.sa@samsung.com's avatar deepak.sa@samsung.com

Move HTMLContentElement & HTMLShadowElement out of shadow/

Move HTMLContentElement & HTMLShadowElement out of shadow/ and
into html/.

Reference CL: https://codereview.chromium.org/27009005/

Review URL: https://codereview.chromium.org/183893019

git-svn-id: svn://svn.chromium.org/blink/trunk@168530 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 4ef03bf7
......@@ -141,6 +141,7 @@
'html/HTMLButtonElement.idl',
'html/HTMLCanvasElement.idl',
'html/HTMLCollection.idl',
'html/HTMLContentElement.idl',
'html/HTMLDListElement.idl',
'html/HTMLDataListElement.idl',
'html/HTMLDetailsElement.idl',
......@@ -188,6 +189,7 @@
'html/HTMLQuoteElement.idl',
'html/HTMLScriptElement.idl',
'html/HTMLSelectElement.idl',
'html/HTMLShadowElement.idl',
'html/HTMLSourceElement.idl',
'html/HTMLSpanElement.idl',
'html/HTMLStyleElement.idl',
......@@ -252,8 +254,6 @@
'html/canvas/WebGLUniformLocation.idl',
'html/canvas/WebGLVertexArrayObjectOES.idl',
'html/ime/InputMethodContext.idl',
'html/shadow/HTMLContentElement.idl',
'html/shadow/HTMLShadowElement.idl',
'html/track/TextTrack.idl',
'html/track/TextTrackCue.idl',
'html/track/TextTrackCueList.idl',
......@@ -2215,6 +2215,8 @@
'html/HTMLCanvasElement.cpp',
'html/HTMLCanvasElement.h',
'html/HTMLCollection.cpp',
'html/HTMLContentElement.cpp',
'html/HTMLContentElement.h',
'html/HTMLDListElement.cpp',
'html/HTMLDListElement.h',
'html/HTMLDataListElement.cpp',
......@@ -2321,6 +2323,8 @@
'html/HTMLSelectElement.cpp',
'html/HTMLSelectElement.h',
'html/HTMLSelectElementWin.cpp',
'html/HTMLShadowElement.cpp',
'html/HTMLShadowElement.h',
'html/HTMLSourceElement.cpp',
'html/HTMLSourceElement.h',
'html/HTMLSpanElement.cpp',
......@@ -2662,10 +2666,6 @@
'html/shadow/DateTimeSymbolicFieldElement.h',
'html/shadow/DetailsMarkerControl.cpp',
'html/shadow/DetailsMarkerControl.h',
'html/shadow/HTMLContentElement.cpp',
'html/shadow/HTMLContentElement.h',
'html/shadow/HTMLShadowElement.cpp',
'html/shadow/HTMLShadowElement.h',
'html/shadow/MediaControlElementTypes.cpp',
'html/shadow/MediaControlElementTypes.h',
'html/shadow/MediaControlElements.cpp',
......
......@@ -30,7 +30,7 @@
#include "core/dom/Element.h"
#include "core/dom/shadow/ElementShadow.h"
#include "core/html/shadow/HTMLShadowElement.h"
#include "core/html/HTMLShadowElement.h"
namespace WebCore {
......
......@@ -33,8 +33,8 @@
#include "core/dom/ElementTraversal.h"
#include "core/dom/NodeTraversal.h"
#include "core/dom/shadow/ContentDistribution.h"
#include "core/html/shadow/HTMLContentElement.h"
#include "core/html/shadow/HTMLShadowElement.h"
#include "core/html/HTMLContentElement.h"
#include "core/html/HTMLShadowElement.h"
namespace WebCore {
......
......@@ -38,7 +38,7 @@
#include "core/dom/shadow/InsertionPoint.h"
#include "core/dom/shadow/ShadowRootRareData.h"
#include "core/editing/markup.h"
#include "core/html/shadow/HTMLShadowElement.h"
#include "core/html/HTMLShadowElement.h"
#include "public/platform/Platform.h"
namespace WebCore {
......
......@@ -25,12 +25,12 @@
*/
#include "config.h"
#include "core/html/shadow/HTMLContentElement.h"
#include "core/html/HTMLContentElement.h"
#include "HTMLNames.h"
#include "core/css/parser/BisonCSSParser.h"
#include "core/css/SelectorChecker.h"
#include "core/css/SiblingTraversalStrategies.h"
#include "core/css/parser/BisonCSSParser.h"
#include "core/dom/QualifiedName.h"
#include "core/dom/shadow/ElementShadow.h"
#include "core/dom/shadow/ShadowRoot.h"
......@@ -77,8 +77,9 @@ void HTMLContentElement::parseAttribute(const QualifiedName& name, const AtomicS
root->owner()->willAffectSelector();
m_shouldParseSelect = true;
m_select = value;
} else
} else {
InsertionPoint::parseAttribute(name, value);
}
}
bool HTMLContentElement::validateSelect() const
......
// FIXME: Move HTMLContentElement.h here.
#include "core/html/shadow/HTMLContentElement.h"
/*
* Copyright (C) 2011 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef HTMLContentElement_h
#define HTMLContentElement_h
#include "core/css/CSSSelectorList.h"
#include "core/dom/shadow/InsertionPoint.h"
namespace WebCore {
class HTMLContentElement FINAL : public InsertionPoint {
public:
static PassRefPtr<HTMLContentElement> create(Document&);
virtual ~HTMLContentElement();
virtual bool canAffectSelector() const OVERRIDE { return true; }
bool canSelectNode(const Vector<Node*, 32>& siblings, int nth) const;
const CSSSelectorList& selectorList() const;
bool isSelectValid() const;
private:
explicit HTMLContentElement(Document&);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
bool validateSelect() const;
void parseSelect();
bool matchSelector(const Vector<Node*, 32>& siblings, int nth) const;
bool m_shouldParseSelect;
bool m_isValidSelector;
AtomicString m_select;
CSSSelectorList m_selectorList;
};
inline const CSSSelectorList& HTMLContentElement::selectorList() const
{
if (m_shouldParseSelect)
const_cast<HTMLContentElement*>(this)->parseSelect();
return m_selectorList;
}
inline bool HTMLContentElement::isSelectValid() const
{
if (m_shouldParseSelect)
const_cast<HTMLContentElement*>(this)->parseSelect();
return m_isValidSelector;
}
inline bool HTMLContentElement::canSelectNode(const Vector<Node*, 32>& siblings, int nth) const
{
if (m_select.isNull() || m_select.isEmpty())
return true;
if (!isSelectValid())
return false;
if (!siblings[nth]->isElementNode())
return false;
return matchSelector(siblings, nth);
}
}
#endif
......@@ -27,9 +27,9 @@
#include "bindings/v8/ExceptionStatePlaceholder.h"
#include "core/dom/Text.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/html/HTMLContentElement.h"
#include "core/html/HTMLDivElement.h"
#include "core/html/HTMLSummaryElement.h"
#include "core/html/shadow/HTMLContentElement.h"
#include "core/html/shadow/ShadowElementNames.h"
#include "core/rendering/RenderBlockFlow.h"
#include "platform/text/PlatformLocale.h"
......
......@@ -34,9 +34,9 @@
#include "core/events/Event.h"
#include "core/frame/ContentSecurityPolicy.h"
#include "core/frame/LocalFrame.h"
#include "core/html/HTMLContentElement.h"
#include "core/html/HTMLImageLoader.h"
#include "core/html/PluginDocument.h"
#include "core/html/shadow/HTMLContentElement.h"
#include "core/loader/FrameLoaderClient.h"
#include "core/page/EventHandler.h"
#include "core/page/Page.h"
......
......@@ -29,7 +29,7 @@
*/
#include "config.h"
#include "core/html/shadow/HTMLShadowElement.h"
#include "core/html/HTMLShadowElement.h"
#include "HTMLNames.h"
#include "core/dom/shadow/ShadowRoot.h"
......
// FIXME: Move HTMLShadowElement.h here.
#include "core/html/shadow/HTMLShadowElement.h"
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef HTMLShadowElement_h
#define HTMLShadowElement_h
#include "core/dom/shadow/InsertionPoint.h"
#include "wtf/Forward.h"
namespace WebCore {
class HTMLShadowElement FINAL : public InsertionPoint {
public:
static PassRefPtr<HTMLShadowElement> create(Document&);
virtual ~HTMLShadowElement();
ShadowRoot* olderShadowRoot();
private:
explicit HTMLShadowElement(Document&);
virtual InsertionNotificationRequest insertedInto(ContainerNode* insertionPoint) OVERRIDE;
};
} // namespace WebCore
#endif // HTMLShadowElement_h
......@@ -26,9 +26,9 @@
#include "core/events/KeyboardEvent.h"
#include "core/dom/NodeRenderingTraversal.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/html/HTMLContentElement.h"
#include "core/html/HTMLDetailsElement.h"
#include "core/html/shadow/DetailsMarkerControl.h"
#include "core/html/shadow/HTMLContentElement.h"
#include "core/rendering/RenderBlockFlow.h"
namespace WebCore {
......
......@@ -40,6 +40,7 @@
#include "core/frame/FrameHost.h"
#include "core/html/FormDataList.h"
#include "core/html/HTMLInputElement.h"
#include "core/html/HTMLShadowElement.h"
#include "core/html/forms/ButtonInputType.h"
#include "core/html/forms/CheckboxInputType.h"
#include "core/html/forms/ColorInputType.h"
......@@ -64,7 +65,6 @@
#include "core/html/forms/URLInputType.h"
#include "core/html/forms/WeekInputType.h"
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/html/shadow/HTMLShadowElement.h"
#include "core/rendering/RenderTheme.h"
#include "platform/text/PlatformLocale.h"
#include "platform/text/TextBreakIterator.h"
......
/*
* Copyright (C) 2011 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef HTMLContentElement_h
#define HTMLContentElement_h
#include "core/css/CSSSelectorList.h"
#include "core/dom/shadow/InsertionPoint.h"
namespace WebCore {
class HTMLContentElement FINAL : public InsertionPoint {
public:
static PassRefPtr<HTMLContentElement> create(Document&);
virtual ~HTMLContentElement();
virtual bool canAffectSelector() const OVERRIDE { return true; }
bool canSelectNode(const Vector<Node*, 32>& siblings, int nth) const;
const CSSSelectorList& selectorList() const;
bool isSelectValid() const;
private:
explicit HTMLContentElement(Document&);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
bool validateSelect() const;
void parseSelect();
bool matchSelector(const Vector<Node*, 32>& siblings, int nth) const;
bool m_shouldParseSelect;
bool m_isValidSelector;
AtomicString m_select;
CSSSelectorList m_selectorList;
};
inline const CSSSelectorList& HTMLContentElement::selectorList() const
{
if (m_shouldParseSelect)
const_cast<HTMLContentElement*>(this)->parseSelect();
return m_selectorList;
}
inline bool HTMLContentElement::isSelectValid() const
{
if (m_shouldParseSelect)
const_cast<HTMLContentElement*>(this)->parseSelect();
return m_isValidSelector;
}
inline bool HTMLContentElement::canSelectNode(const Vector<Node*, 32>& siblings, int nth) const
{
if (m_select.isNull() || m_select.isEmpty())
return true;
if (!isSelectValid())
return false;
if (!siblings[nth]->isElementNode())
return false;
return matchSelector(siblings, nth);
}
}
#endif
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef HTMLShadowElement_h
#define HTMLShadowElement_h
#include "core/dom/shadow/InsertionPoint.h"
#include "wtf/Forward.h"
namespace WebCore {
class HTMLShadowElement FINAL : public InsertionPoint {
public:
static PassRefPtr<HTMLShadowElement> create(Document&);
virtual ~HTMLShadowElement();
ShadowRoot* olderShadowRoot();
private:
explicit HTMLShadowElement(Document&);
virtual InsertionNotificationRequest insertedInto(ContainerNode* insertionPoint) OVERRIDE;
};
} // namespace WebCore
#endif // HTMLShadowElement_h
......@@ -47,7 +47,7 @@
#include "core/frame/LocalFrame.h"
#include "core/html/HTMLAreaElement.h"
#include "core/html/HTMLImageElement.h"
#include "core/html/shadow/HTMLShadowElement.h"
#include "core/html/HTMLShadowElement.h"
#include "core/page/Chrome.h"
#include "core/page/ChromeClient.h"
#include "core/page/EventHandler.h"
......
......@@ -82,13 +82,13 @@
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
#include "core/html/HTMLContentElement.h"
#include "core/html/HTMLIFrameElement.h"
#include "core/html/HTMLInputElement.h"
#include "core/html/HTMLMediaElement.h"
#include "core/html/HTMLSelectElement.h"
#include "core/html/HTMLTextAreaElement.h"
#include "core/html/forms/FormController.h"
#include "core/html/shadow/HTMLContentElement.h"
#include "core/inspector/InspectorClient.h"
#include "core/inspector/InspectorConsoleAgent.h"
#include "core/inspector/InspectorController.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment