Diff
Modified: trunk/Source/WebCore/ChangeLog (154974 => 154975)
--- trunk/Source/WebCore/ChangeLog 2013-09-03 08:54:26 UTC (rev 154974)
+++ trunk/Source/WebCore/ChangeLog 2013-09-03 10:10:37 UTC (rev 154975)
@@ -1,3 +1,22 @@
+2013-09-03 Allan Sandfeld Jensen <allan.jen...@digia.com>
+
+ [Qt] Remove dead code for QtXmlPatterns
+ https://bugs.webkit.org/show_bug.cgi?id=120624
+
+ Reviewed by Simon Hausmann.
+
+ Remove code supporting XSLT using QtXmlPatterns which has been
+ dead for some time.
+
+ * Target.pri:
+ * WebCore.pri:
+ * dom/TransformSourceQt.cpp: Removed.
+ * xml/XSLStyleSheetQt.cpp: Removed.
+ * xml/XSLTProcessorQt.cpp: Removed.
+ * xml/parser/XMLDocumentParserQt.cpp:
+ (WebCore::XMLDocumentParser::doEnd):
+ (WebCore::XMLDocumentParser::parseProcessingInstruction):
+
2013-09-03 Mihnea Ovidenie <mih...@adobe.com>
[CSS Regions] position: fixed is computed relative to the first region, not the viewport
Modified: trunk/Source/WebCore/Target.pri (154974 => 154975)
--- trunk/Source/WebCore/Target.pri 2013-09-03 08:54:26 UTC (rev 154974)
+++ trunk/Source/WebCore/Target.pri 2013-09-03 10:10:37 UTC (rev 154975)
@@ -3572,12 +3572,6 @@
xml/XSLImportRule.h \
xml/XSLTUnicodeSort.h
- } else {
- SOURCES += \
- dom/TransformSourceQt.cpp \
- xml/XSLStyleSheetQt.cpp \
- xml/XSLTProcessor.cpp \
- xml/XSLTProcessorQt.cpp
}
}
Modified: trunk/Source/WebCore/WebCore.pri (154974 => 154975)
--- trunk/Source/WebCore/WebCore.pri 2013-09-03 08:54:26 UTC (rev 154974)
+++ trunk/Source/WebCore/WebCore.pri 2013-09-03 10:10:37 UTC (rev 154975)
@@ -110,19 +110,22 @@
INCLUDEPATH += $$WEBCORE_GENERATED_SOURCES_DIR
+use?(LIBXML2) {
+ mac {
+ INCLUDEPATH += /usr/include/libxml2
+ LIBS += -lxml2
+ } else {
+ PKGCONFIG += libxml-2.0
+ }
+}
+
enable?(XSLT) {
- use?(LIBXML2) {
- mac {
- INCLUDEPATH += /usr/include/libxslt /usr/include/libxml2
- LIBS += -lxml2 -lxslt
- } else {
- PKGCONFIG += libxslt libxml-2.0
- }
+ mac {
+ INCLUDEPATH += /usr/include/libxslt
+ LIBS += -lxslt
} else {
- QT *= xmlpatterns
+ PKGCONFIG += libxslt
}
-} else:!mac:use?(LIBXML2) {
- PKGCONFIG += libxml-2.0
}
use?(ZLIB) {
Deleted: trunk/Source/WebCore/dom/TransformSourceQt.cpp (154974 => 154975)
--- trunk/Source/WebCore/dom/TransformSourceQt.cpp 2013-09-03 08:54:26 UTC (rev 154974)
+++ trunk/Source/WebCore/dom/TransformSourceQt.cpp 2013-09-03 10:10:37 UTC (rev 154975)
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2009 Jakub Wieczorek <faw...@gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "TransformSource.h"
-
-namespace WebCore {
-
-TransformSource::TransformSource(const PlatformTransformSource& source)
- : m_source(source)
-{
-}
-
-TransformSource::~TransformSource()
-{
-}
-
-}
Deleted: trunk/Source/WebCore/xml/XSLStyleSheetQt.cpp (154974 => 154975)
--- trunk/Source/WebCore/xml/XSLStyleSheetQt.cpp 2013-09-03 08:54:26 UTC (rev 154974)
+++ trunk/Source/WebCore/xml/XSLStyleSheetQt.cpp 2013-09-03 10:10:37 UTC (rev 154975)
@@ -1,116 +0,0 @@
-/*
- * This file is part of the XSL implementation.
- *
- * Copyright (C) 2009 Jakub Wieczorek <faw...@gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "XSLStyleSheet.h"
-
-#if ENABLE(XSLT)
-
-#include "DOMWindow.h"
-#include "Document.h"
-#include "Node.h"
-#include "NotImplemented.h"
-#include "XSLImportRule.h"
-#include "XSLTProcessor.h"
-
-namespace WebCore {
-
-XSLStyleSheet::XSLStyleSheet(Node* parentNode, const String& originalURL, const KURL& finalURL, bool embedded)
- : m_ownerNode(parentNode)
- , m_originalURL(originalURL)
- , m_finalURL(finalURL)
- , m_isDisabled(false)
- , m_embedded(embedded)
-{
-}
-
-XSLStyleSheet::~XSLStyleSheet()
-{
- for (unsigned i = 0; i < m_children.size(); ++i) {
- ASSERT(m_children.at(i)->parentStyleSheet() == this);
- m_children.at(i)->setParentStyleSheet(0);
- }
-}
-
-bool XSLStyleSheet::isLoading() const
-{
- notImplemented();
- return false;
-}
-
-void XSLStyleSheet::checkLoaded()
-{
- if (ownerNode())
- ownerNode()->sheetLoaded();
-}
-
-void XSLStyleSheet::clearDocuments()
-{
- notImplemented();
-}
-
-CachedResourceLoader* XSLStyleSheet::cachedResourceLoader()
-{
- Document* document = ownerDocument();
- if (!document)
- return 0;
- return document->cachedResourceLoader();
-}
-
-bool XSLStyleSheet::parseString(const String& string)
-{
- // FIXME: Fix QXmlQuery so that it allows compiling the stylesheet before setting the document
- // to be transformed. This way we could not only check if the stylesheet is correct before using it
- // but also turn XSLStyleSheet::sheetString() into XSLStyleSheet::query() that returns a QXmlQuery.
-
- m_sheetString = string;
- return !m_sheetString.isEmpty();
-}
-
-void XSLStyleSheet::loadChildSheets()
-{
- notImplemented();
-}
-
-void XSLStyleSheet::loadChildSheet(const String&)
-{
- notImplemented();
-}
-
-Document* XSLStyleSheet::ownerDocument()
-{
- Node* node = ownerNode();
- return node ? node->document() : 0;
-}
-
-void XSLStyleSheet::setParentStyleSheet(XSLStyleSheet*)
-{
- notImplemented();
-}
-
-void XSLStyleSheet::markAsProcessed()
-{
- notImplemented();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(XSLT)
Deleted: trunk/Source/WebCore/xml/XSLTProcessorQt.cpp (154974 => 154975)
--- trunk/Source/WebCore/xml/XSLTProcessorQt.cpp 2013-09-03 08:54:26 UTC (rev 154974)
+++ trunk/Source/WebCore/xml/XSLTProcessorQt.cpp 2013-09-03 10:10:37 UTC (rev 154975)
@@ -1,183 +0,0 @@
-/*
- * This file is part of the XSL implementation.
- *
- * Copyright (C) 2009 Jakub Wieczorek <faw...@gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#if ENABLE(XSLT)
-
-#include "XSLTProcessor.h"
-
-#include "Console.h"
-#include "Document.h"
-#include "DOMWindow.h"
-#include "Frame.h"
-#include "SecurityOrigin.h"
-#include "TransformSource.h"
-#include "markup.h"
-#include <wtf/Assertions.h>
-#include <wtf/Vector.h>
-
-#include <qabstractmessagehandler.h>
-#include <qabstracturiresolver.h>
-#include <qbuffer.h>
-#include <qsourcelocation.h>
-#include <qxmlquery.h>
-
-namespace WebCore {
-
-class XSLTMessageHandler : public QAbstractMessageHandler {
-
-public:
- XSLTMessageHandler(Document* document = 0);
- virtual void handleMessage(QtMsgType type, const QString& description,
- const QUrl& identifier, const QSourceLocation& sourceLocation);
-
-private:
- Document* m_document;
-};
-
-XSLTMessageHandler::XSLTMessageHandler(Document* document)
- : QAbstractMessageHandler()
- , m_document(document)
-{
-}
-
-void XSLTMessageHandler::handleMessage(QtMsgType type, const QString& description,
- const QUrl&, const QSourceLocation& sourceLocation)
-{
- if (!m_document->frame())
- return;
-
- MessageLevel level;
- switch (type) {
- case QtDebugMsg:
- level = DebugMessageLevel;
- break;
- case QtWarningMsg:
- level = WarningMessageLevel;
- break;
- case QtCriticalMsg:
- case QtFatalMsg:
- level = ErrorMessageLevel;
- break;
- default:
- level = LogMessageLevel;
- break;
- }
-
- Console* console = m_document->domWindow()->console();
- console->addMessage(XMLMessageSource, level, description, sourceLocation.uri().toString(), sourceLocation.line(), sourceLocation.column());
-}
-
-class XSLTUriResolver : public QAbstractUriResolver {
-
-public:
- XSLTUriResolver(Document* document);
- virtual QUrl resolve(const QUrl& relative, const QUrl& baseURI) const;
-
-private:
- Document* m_document;
-};
-
-XSLTUriResolver::XSLTUriResolver(Document* document)
- : QAbstractUriResolver()
- , m_document(document)
-{
-}
-
-QUrl XSLTUriResolver::resolve(const QUrl& relative, const QUrl& baseURI) const
-{
- QUrl url = ""
-
- if (!m_document->frame() || !m_document->securityOrigin()->canRequest(url))
- return QUrl();
- return url;
-}
-
-bool XSLTProcessor::transformToString(Node* sourceNode, String&, String& resultString, String&)
-{
- bool success = false;
-
- RefPtr<XSLStyleSheet> stylesheet = m_stylesheet;
- if (!stylesheet && m_stylesheetRootNode) {
- Node* node = m_stylesheetRootNode.get();
- stylesheet = XSLStyleSheet::createForXSLTProcessor(node->parentNode() ? node->parentNode() : node,
- node->document()->url().string(),
- node->document()->url()); // FIXME: Should we use baseURL here?
-
- // According to Mozilla documentation, the node must be a Document node, an xsl:stylesheet or xsl:transform element.
- // But we just use text content regardless of node type.
- stylesheet->parseString(createMarkup(node));
- }
-
- if (!stylesheet || stylesheet->sheetString().isEmpty())
- return success;
-
- RefPtr<Document> ownerDocument = sourceNode->document();
- bool sourceIsDocument = (sourceNode == ownerDocument.get());
-
- QXmlQuery query(QXmlQuery::XSLT20);
-
- XSLTMessageHandler messageHandler(ownerDocument.get());
- XSLTUriResolver uriResolver(ownerDocument.get());
- query.setMessageHandler(&messageHandler);
-
- XSLTProcessor::ParameterMap::iterator end = m_parameters.end();
- for (XSLTProcessor::ParameterMap::iterator it = m_parameters.begin(); it != end; ++it)
- query.bindVariable(QString(it->key), QXmlItem(QVariant(QString(it->value))));
-
- QString source;
- if (sourceIsDocument && ownerDocument->transformSource())
- source = ownerDocument->transformSource()->platformSource();
- if (!sourceIsDocument || source.isEmpty())
- source = createMarkup(sourceNode);
-
- QBuffer inputBuffer;
- QBuffer styleSheetBuffer;
- QBuffer outputBuffer;
-
- inputBuffer.setData(source.toUtf8());
- styleSheetBuffer.setData(QString(stylesheet->sheetString()).toUtf8());
-
- inputBuffer.open(QIODevice::ReadOnly);
- styleSheetBuffer.open(QIODevice::ReadOnly);
- outputBuffer.open(QIODevice::ReadWrite);
-
- query.setFocus(&inputBuffer);
- query.setQuery(&styleSheetBuffer, QUrl(stylesheet->href()));
-
- query.setUriResolver(&uriResolver);
-
- success = query.evaluateTo(&outputBuffer);
- outputBuffer.reset();
- resultString = QString::fromUtf8(outputBuffer.readAll()).trimmed();
-
- if (m_stylesheet) {
- m_stylesheet->clearDocuments();
- m_stylesheet = 0;
- }
-
- return success;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(XSLT)
Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParserQt.cpp (154974 => 154975)
--- trunk/Source/WebCore/xml/parser/XMLDocumentParserQt.cpp 2013-09-03 08:54:26 UTC (rev 154974)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParserQt.cpp 2013-09-03 10:10:37 UTC (rev 154975)
@@ -212,22 +212,6 @@
void XMLDocumentParser::doEnd()
{
-#if ENABLE(XSLT)
- if (m_sawXSLTransform) {
- document()->setTransformSource(adoptPtr(new TransformSource(m_originalSourceForTransform.toString())));
- document()->setParsing(false); // Make the doc think it's done, so it will apply xsl sheets.
- document()->styleResolverChanged(RecalcStyleImmediately);
-
- // styleResolverChanged() call can detach the parser and null out its document.
- // In that case, we just bail out.
- if (isDetached())
- return;
-
- document()->setParsing(true);
- DocumentParser::stopParsing();
- }
-#endif
-
if (m_stream.error() == QXmlStreamReader::PrematureEndOfDocumentError
|| (m_wroteText && !m_sawFirstElement && !m_sawXSLTransform && !m_sawError))
handleError(XMLErrors::fatal, qPrintable(m_stream.errorString()), textPosition());
@@ -591,11 +575,6 @@
if (pi->isCSS())
m_sawCSS = true;
-#if ENABLE(XSLT)
- m_sawXSLTransform = !m_sawFirstElement && pi->isXSL();
- if (m_sawXSLTransform && !document()->transformSourceDocument())
- stopParsing();
-#endif
}
void XMLDocumentParser::parseCdata()