diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/html')
31 files changed, 493 insertions, 77 deletions
diff --git a/src/3rdparty/webkit/WebCore/html/CanvasRenderingContext2D.cpp b/src/3rdparty/webkit/WebCore/html/CanvasRenderingContext2D.cpp index 7ab0da5..37f4799 100644 --- a/src/3rdparty/webkit/WebCore/html/CanvasRenderingContext2D.cpp +++ b/src/3rdparty/webkit/WebCore/html/CanvasRenderingContext2D.cpp @@ -937,6 +937,13 @@ void CanvasRenderingContext2D::checkOrigin(const KURL& url) m_canvas->setOriginTainted(); } +void CanvasRenderingContext2D::checkOrigin(const String& url) +{ + RefPtr<SecurityOrigin> origin = SecurityOrigin::createFromString(url); + if (!m_canvas->document()->securityOrigin()->canAccess(origin.get())) + m_canvas->setOriginTainted(); +} + void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, float x, float y) { ASSERT(image); @@ -1082,7 +1089,7 @@ void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, const FloatRec return; if (m_canvas->originClean()) - checkOrigin(video->src()); + checkOrigin(video->currentSrc()); if (m_canvas->originClean() && !video->hasSingleSecurityOrigin()) m_canvas->setOriginTainted(); diff --git a/src/3rdparty/webkit/WebCore/html/CanvasRenderingContext2D.h b/src/3rdparty/webkit/WebCore/html/CanvasRenderingContext2D.h index 0b000a3..f6baa70 100644 --- a/src/3rdparty/webkit/WebCore/html/CanvasRenderingContext2D.h +++ b/src/3rdparty/webkit/WebCore/html/CanvasRenderingContext2D.h @@ -260,6 +260,7 @@ namespace WebCore { void prepareGradientForDashboard(CanvasGradient* gradient) const; void checkOrigin(const KURL&); + void checkOrigin(const String&); HTMLCanvasElement* m_canvas; Vector<State, 1> m_stateStack; diff --git a/src/3rdparty/webkit/WebCore/html/DataGridColumn.cpp b/src/3rdparty/webkit/WebCore/html/DataGridColumn.cpp new file mode 100644 index 0000000..136c08e --- /dev/null +++ b/src/3rdparty/webkit/WebCore/html/DataGridColumn.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2009 Apple 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE COMPUTER, INC. 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. + */ + +#include "config.h" +#include "DataGridColumn.h" + +#include "DataGridColumnList.h" + +namespace WebCore { + +void DataGridColumn::setPrimary(bool primary) +{ + if (m_primary != primary) { + m_primary = primary; + if (m_columns) + m_columns->primaryColumnChanged(this); + } +} + +} // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/html/DataGridColumn.h b/src/3rdparty/webkit/WebCore/html/DataGridColumn.h new file mode 100644 index 0000000..8e63cd6 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/html/DataGridColumn.h @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2009 Apple 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE COMPUTER, INC. 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 DataGridColumn_h +#define DataGridColumn_h + +#include "AtomicString.h" +#include <wtf/PassRefPtr.h> +#include <wtf/RefCounted.h> + +namespace WebCore { + +class DataGridColumnList; + +class DataGridColumn : public RefCounted<DataGridColumn> { +public: + static PassRefPtr<DataGridColumn> create(DataGridColumnList* columns, const String& columnID, const String& label, const String& type, bool primary, unsigned short sortable) + { + return new DataGridColumn(columns, columnID, label, type, primary, sortable); + } + + const AtomicString& id() const { return m_id; } + void setId(const AtomicString& id) { m_id = id; } + + const AtomicString& label() const { return m_label; } + void setLabel(const AtomicString& label) { m_label = label; } + + const AtomicString& type() const { return m_type; } + void setType(const AtomicString& type) { m_type = type; } + + unsigned short sortable() const { return m_sortable; } + void setSortable(unsigned short sortable) { m_sortable = sortable; } + + unsigned short sortDirection() const { return m_sortDirection; } + void setSortDirection(unsigned short sortDirection) { m_sortDirection = sortDirection; } + + bool primary() const { return m_primary; } + void setPrimary(bool); + + void detachFromColumnList() { m_columns = 0; } + +private: + DataGridColumn(DataGridColumnList* columns, const String& columnID, const String& label, const String& type, bool primary, unsigned short sortable) + : m_columns(columns) + , m_id(columnID) + , m_label(label) + , m_type(type) + , m_primary(primary) + , m_sortable(sortable) + , m_sortDirection(0) + { + } + + DataGridColumnList* m_columns; // Not refcounted. The columns list will null out our reference when it goes away. + + AtomicString m_id; + AtomicString m_label; + AtomicString m_type; + + bool m_primary; + + unsigned short m_sortable; + unsigned short m_sortDirection; +}; + +} // namespace WebCore + +#endif // DataGridColumn_h diff --git a/src/3rdparty/webkit/WebCore/html/DataGridColumn.idl b/src/3rdparty/webkit/WebCore/html/DataGridColumn.idl new file mode 100644 index 0000000..04418a1 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/html/DataGridColumn.idl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2009 Apple 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE COMPUTER, INC. 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. + */ + +module html { + + interface [ + GenerateConstructor + ] DataGridColumn { + attribute DOMString id; // The identifier for the column. + attribute DOMString label; // The text to display in the column. + attribute DOMString type; // The type of data displayed in this column. + + const unsigned short NEVER_SORTED = 0; + const unsigned short ALWAYS_SORTED = 1; + const unsigned short SOMETIMES_SORTED = 2; + attribute unsigned short sortable; // Whether or not the column can be sorted. + + const unsigned short NATURAL_SORT = 0; + const unsigned short SORT_ASCENDING = 1; + const unsigned short SORC_DESCENDING = 2; + attribute unsigned short sortDirection; // The sort direction for the column. Valid values are ascending, descending and natural (no sort applied). + + attribute boolean primary; // Whether or not this is the primary column of the tree (this will be where the disclosure triangle and connecting tree lines will display) + }; + +} diff --git a/src/3rdparty/webkit/WebCore/html/DataGridColumnList.cpp b/src/3rdparty/webkit/WebCore/html/DataGridColumnList.cpp new file mode 100644 index 0000000..48f7d60 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/html/DataGridColumnList.cpp @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2009 Apple 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE COMPUTER, INC. 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. + */ + +#include "config.h" +#include "DataGridColumnList.h" + +#include "AtomicString.h" +#include "PlatformString.h" + +namespace WebCore { + +DataGridColumnList::~DataGridColumnList() +{ + clear(); +} + +DataGridColumn* DataGridColumnList::itemWithName(const AtomicString& name) const +{ + unsigned length = m_columns.size(); + for (unsigned i = 0; i < length; ++i) { + if (m_columns[i]->id() == name) + return m_columns[i].get(); + } + return 0; +} + +DataGridColumn* DataGridColumnList::add(const String& id, const String& label, const String& type, bool primary, unsigned short sortable) +{ + RefPtr<DataGridColumn> column = DataGridColumn::create(this, id, label, type, primary, sortable); + if (primary) + m_primaryColumn = column; + m_columns.append(column); + return column.get(); +} + +void DataGridColumnList::remove(DataGridColumn* col) +{ + size_t index = m_columns.find(col); + if (index == notFound) + return; + m_columns.remove(index); + if (col == m_primaryColumn) + m_primaryColumn = 0; + if (col == m_sortColumn) + m_sortColumn = 0; +} + +void DataGridColumnList::move(DataGridColumn* col, unsigned long index) +{ + size_t colIndex = m_columns.find(col); + if (colIndex == notFound) + return; + m_columns.insert(index, col); +} + +void DataGridColumnList::clear() +{ + unsigned length = m_columns.size(); + for (unsigned i = 0; i < length; ++i) + m_columns[i]->detachFromColumnList(); + m_columns.clear(); + m_primaryColumn = 0; + m_sortColumn = 0; +} + +void DataGridColumnList::primaryColumnChanged(DataGridColumn* col) +{ + if (col->primary()) + m_primaryColumn = col; + else if (m_primaryColumn = col) + m_primaryColumn = 0; + + // FIXME: Invalidate the tree. +} + +} // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/html/DataGridColumnList.h b/src/3rdparty/webkit/WebCore/html/DataGridColumnList.h new file mode 100644 index 0000000..d0caebe --- /dev/null +++ b/src/3rdparty/webkit/WebCore/html/DataGridColumnList.h @@ -0,0 +1,48 @@ +#ifndef DataGridColumnList_h +#define DataGridColumnList_h + +#include "DataGridColumn.h" + +#include <wtf/PassRefPtr.h> +#include <wtf/RefCounted.h> +#include <wtf/Vector.h> + +namespace WebCore { + +class AtomicString; + +class DataGridColumnList : public RefCounted<DataGridColumnList> { + friend class DataGridColumn; +public: + static PassRefPtr<DataGridColumnList> create() + { + return new DataGridColumnList(); + } + + ~DataGridColumnList(); + + unsigned length() const { return m_columns.size(); } + + DataGridColumn* item(unsigned index) const { return m_columns[index].get(); } + DataGridColumn* itemWithName(const AtomicString&) const; + + DataGridColumn* primaryColumn() const { return m_primaryColumn.get(); } + + DataGridColumn* sortColumn() const { return m_sortColumn.get(); } + + DataGridColumn* add(const String& id, const String& label, const String& type, bool primary, unsigned short sortable); + void remove(DataGridColumn*); + void move(DataGridColumn*, unsigned long index); + void clear(); + +private: + void primaryColumnChanged(DataGridColumn* col); + + Vector<RefPtr<DataGridColumn> > m_columns; + RefPtr<DataGridColumn> m_primaryColumn; + RefPtr<DataGridColumn> m_sortColumn; +}; + +} // namespace WebCore + +#endif // DataGridColumnList_h diff --git a/src/3rdparty/webkit/WebCore/html/DataGridColumnList.idl b/src/3rdparty/webkit/WebCore/html/DataGridColumnList.idl new file mode 100644 index 0000000..cab4339 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/html/DataGridColumnList.idl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2009 Apple 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE COMPUTER, INC. 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. + */ + +module html { + + interface [ + GenerateConstructor, + HasIndexGetter, + HasNameGetter + ] DataGridColumnList { + DataGridColumn item(in [IsIndex] unsigned long index); + readonly attribute unsigned long length; + + readonly attribute DataGridColumn sortColumn; + readonly attribute DataGridColumn primaryColumn; + + DataGridColumn add(in DOMString id, in DOMString label, in DOMString type, in boolean primary, in unsigned short sortable); + void remove(in DataGridColumn column); + void move(in DataGridColumn column, in unsigned long index); + void clear(); + }; + +} diff --git a/src/3rdparty/webkit/WebCore/html/HTMLAttributeNames.in b/src/3rdparty/webkit/WebCore/html/HTMLAttributeNames.in index d148998..a29d6d2 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLAttributeNames.in +++ b/src/3rdparty/webkit/WebCore/html/HTMLAttributeNames.in @@ -15,10 +15,13 @@ archive aria-activedescendant aria-checked aria-describedby +aria-disabled +aria-hidden aria-labeledby aria-labelledby aria-level aria-pressed +aria-readonly aria-valuemax aria-valuemin aria-valuenow diff --git a/src/3rdparty/webkit/WebCore/html/HTMLDataGridCellElement.cpp b/src/3rdparty/webkit/WebCore/html/HTMLDataGridCellElement.cpp index 64a9d10..d06ad82 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLDataGridCellElement.cpp +++ b/src/3rdparty/webkit/WebCore/html/HTMLDataGridCellElement.cpp @@ -88,5 +88,4 @@ void HTMLDataGridCellElement::setProgress(float progress) setAttribute(progressAttr, String::number(progress)); } -} - +} // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/html/HTMLDataGridCellElement.h b/src/3rdparty/webkit/WebCore/html/HTMLDataGridCellElement.h index b17634b..9de6e40 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLDataGridCellElement.h +++ b/src/3rdparty/webkit/WebCore/html/HTMLDataGridCellElement.h @@ -30,8 +30,7 @@ namespace WebCore { -class HTMLDataGridCellElement : public HTMLElement -{ +class HTMLDataGridCellElement : public HTMLElement { public: HTMLDataGridCellElement(const QualifiedName&, Document*); diff --git a/src/3rdparty/webkit/WebCore/html/HTMLDataGridCellElement.idl b/src/3rdparty/webkit/WebCore/html/HTMLDataGridCellElement.idl index 32d820c..4d15f6f 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLDataGridCellElement.idl +++ b/src/3rdparty/webkit/WebCore/html/HTMLDataGridCellElement.idl @@ -25,15 +25,17 @@ module html { -interface [GenerateConstructor] HTMLDataGridCellElement : HTMLElement { - attribute DOMString label; // The text to display in the column, assuming the type supports text. - - attribute boolean focused; // Whether or not this cell is currently focused. - - attribute boolean checked; // The checked state of the column, assuming the type of the column is checkbox. - attribute boolean indeterminate; // If the checked state is indeterminate. - - attribute float progress; // For progress cells, a value from 0-1.0 indicating the state of progress. -}; + interface [ + GenerateConstructor + ] HTMLDataGridCellElement : HTMLElement { + attribute DOMString label; // The text to display in the column, assuming the type supports text. + + attribute boolean focused; // Whether or not this cell is currently focused. + + attribute boolean checked; // The checked state of the column, assuming the type of the column is checkbox. + attribute boolean indeterminate; // If the checked state is indeterminate. + + attribute float progress; // For progress cells, a value from 0-1.0 indicating the state of progress. + }; } diff --git a/src/3rdparty/webkit/WebCore/html/HTMLDataGridColElement.cpp b/src/3rdparty/webkit/WebCore/html/HTMLDataGridColElement.cpp index b5c8714..b209447 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLDataGridColElement.cpp +++ b/src/3rdparty/webkit/WebCore/html/HTMLDataGridColElement.cpp @@ -58,24 +58,35 @@ void HTMLDataGridColElement::setType(const String& type) setAttribute(typeAttr, type); } -bool HTMLDataGridColElement::sortable() const +unsigned short HTMLDataGridColElement::sortable() const { return hasAttribute(sortableAttr); } -void HTMLDataGridColElement::setSortable(bool sortable) +void HTMLDataGridColElement::setSortable(unsigned short sortable) { setAttribute(sortableAttr, sortable ? "" : 0); } -String HTMLDataGridColElement::sortDirection() const +unsigned short HTMLDataGridColElement::sortDirection() const { - return getAttribute(sortdirectionAttr); + String sortDirection = getAttribute(sortdirectionAttr); + if (equalIgnoringCase(sortDirection, "ascending")) + return 1; + if (equalIgnoringCase(sortDirection, "descending")) + return 2; + return 0; } -void HTMLDataGridColElement::setSortDirection(const String& sortDirection) +void HTMLDataGridColElement::setSortDirection(unsigned short sortDirection) { - setAttribute(sortdirectionAttr, sortDirection); + // FIXME: Check sortable rules. + if (sortDirection == 0) + setAttribute(sortdirectionAttr, "natural"); + else if (sortDirection == 1) + setAttribute(sortdirectionAttr, "ascending"); + else if (sortDirection == 2) + setAttribute(sortdirectionAttr, "descending"); } bool HTMLDataGridColElement::primary() const @@ -88,5 +99,4 @@ void HTMLDataGridColElement::setPrimary(bool primary) setAttribute(primaryAttr, primary ? "" : 0); } -} - +} // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/html/HTMLDataGridColElement.h b/src/3rdparty/webkit/WebCore/html/HTMLDataGridColElement.h index 6d599b1..87133cc 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLDataGridColElement.h +++ b/src/3rdparty/webkit/WebCore/html/HTMLDataGridColElement.h @@ -30,8 +30,7 @@ namespace WebCore { -class HTMLDataGridColElement : public HTMLElement -{ +class HTMLDataGridColElement : public HTMLElement { public: HTMLDataGridColElement(const QualifiedName&, Document*); @@ -44,16 +43,16 @@ public: String type() const; void setType(const String&); - bool sortable() const; - void setSortable(bool); + unsigned short sortable() const; + void setSortable(unsigned short); - String sortDirection() const; - void setSortDirection(const String&); + unsigned short sortDirection() const; + void setSortDirection(unsigned short); bool primary() const; void setPrimary(bool); }; -} //namespace +} // namespace WebCore -#endif +#endif // HTMLDataGridColElement_h diff --git a/src/3rdparty/webkit/WebCore/html/HTMLDataGridColElement.idl b/src/3rdparty/webkit/WebCore/html/HTMLDataGridColElement.idl index 59c3be0..c72751c 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLDataGridColElement.idl +++ b/src/3rdparty/webkit/WebCore/html/HTMLDataGridColElement.idl @@ -25,14 +25,16 @@ module html { -interface [GenerateConstructor] HTMLDataGridColElement : HTMLElement { - attribute DOMString label; // The text to display in the column. - attribute DOMString type; // The type of data displayed in this column. + interface [ + GenerateConstructor + ] HTMLDataGridColElement : HTMLElement { + attribute DOMString label; // The text to display in the column. + attribute DOMString type; // The type of data displayed in this column. - attribute boolean sortable; // Whether or not the column can be sorted. - attribute DOMString sortDirection; // The sort direction for the column. Valid values are ascending, descending and natural (no sort applied). + attribute unsigned short sortable; // Whether or not the column can be sorted. Values are none, ascending/descending, and ascending/descending/na + attribute unsigned short sortDirection; // The sort direction for the column. Valid values are ascending, descending and natural (no sort applied). - attribute boolean primary; // Whether or not this is the primary column of the tree (this will be where the disclosure triangle and connecting tree lines will display) -}; + attribute boolean primary; // Whether or not this is the primary column of the tree (this will be where the disclosure triangle and connecting tree lines will display) + }; } diff --git a/src/3rdparty/webkit/WebCore/html/HTMLDataGridElement.cpp b/src/3rdparty/webkit/WebCore/html/HTMLDataGridElement.cpp index a9e2f3d..2d9f852 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLDataGridElement.cpp +++ b/src/3rdparty/webkit/WebCore/html/HTMLDataGridElement.cpp @@ -38,6 +38,7 @@ HTMLDataGridElement::HTMLDataGridElement(const QualifiedName& tagName, Document* : HTMLElement(tagName, document) , m_initializationTimer(this, &HTMLDataGridElement::initializationTimerFired) { + m_columns = DataGridColumnList::create(); } HTMLDataGridElement::~HTMLDataGridElement() diff --git a/src/3rdparty/webkit/WebCore/html/HTMLDataGridElement.h b/src/3rdparty/webkit/WebCore/html/HTMLDataGridElement.h index 2dad4d0..646c97e 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLDataGridElement.h +++ b/src/3rdparty/webkit/WebCore/html/HTMLDataGridElement.h @@ -26,6 +26,7 @@ #ifndef HTMLDataGridElement_h #define HTMLDataGridElement_h +#include "DataGridColumnList.h" #include "DataGridDataSource.h" #include "HTMLElement.h" #include "Timer.h" @@ -39,26 +40,30 @@ public: virtual int tagPriority() const { return 6; } // Same as <select>s virtual bool checkDTD(const Node*); - + virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); bool autofocus() const; void setAutofocus(bool); - + bool disabled() const; void setDisabled(bool); - + bool multiple() const; void setMultiple(bool); void setDataSource(PassRefPtr<DataGridDataSource>); DataGridDataSource* dataSource() const { return m_dataSource.get(); } + DataGridColumnList* columns() const { return m_columns.get(); } + private: void initializationTimerFired(Timer<HTMLDataGridElement>*); Timer<HTMLDataGridElement> m_initializationTimer; RefPtr<DataGridDataSource> m_dataSource; + + RefPtr<DataGridColumnList> m_columns; }; } // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/html/HTMLDataGridElement.idl b/src/3rdparty/webkit/WebCore/html/HTMLDataGridElement.idl index f777a9c..b4b0897 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLDataGridElement.idl +++ b/src/3rdparty/webkit/WebCore/html/HTMLDataGridElement.idl @@ -30,6 +30,8 @@ module html { ] HTMLDataGridElement : HTMLElement { attribute [Custom] DataGridDataSource dataSource; + readonly attribute DataGridColumnList columns; + attribute boolean autofocus; // Whether or not the datagrid should autofocus. attribute boolean disabled; // Whether or not the datagrid can be interacted with. attribute boolean multiple; // Whether or not the datagrid supports multiple selection. diff --git a/src/3rdparty/webkit/WebCore/html/HTMLDataGridRowElement.cpp b/src/3rdparty/webkit/WebCore/html/HTMLDataGridRowElement.cpp index 87fb31d..e671806 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLDataGridRowElement.cpp +++ b/src/3rdparty/webkit/WebCore/html/HTMLDataGridRowElement.cpp @@ -75,4 +75,4 @@ void HTMLDataGridRowElement::setExpanded(bool expanded) setAttribute(expandedAttr, expanded ? "" : 0); } -} +} // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/html/HTMLDataGridRowElement.h b/src/3rdparty/webkit/WebCore/html/HTMLDataGridRowElement.h index 9774baa..d911db2 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLDataGridRowElement.h +++ b/src/3rdparty/webkit/WebCore/html/HTMLDataGridRowElement.h @@ -30,8 +30,7 @@ namespace WebCore { -class HTMLDataGridRowElement : public HTMLElement -{ +class HTMLDataGridRowElement : public HTMLElement { public: HTMLDataGridRowElement(const QualifiedName&, Document*); @@ -51,4 +50,3 @@ public: } // namespace WebCore #endif // HTMLDataGridRowElement_h - diff --git a/src/3rdparty/webkit/WebCore/html/HTMLDataGridRowElement.idl b/src/3rdparty/webkit/WebCore/html/HTMLDataGridRowElement.idl index 825bec6..4aeb4d5 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLDataGridRowElement.idl +++ b/src/3rdparty/webkit/WebCore/html/HTMLDataGridRowElement.idl @@ -25,11 +25,13 @@ module html { -interface [GenerateConstructor] HTMLDataGridRowElement : HTMLElement { - attribute boolean selected; // Whether or not the row is currently selected. - attribute boolean focused; // Whether or not the row is the current object in the tree for keyboard navigation (or as the principal item of a multiple selection). - - attribute boolean expanded; // Whether or not the row is open (if it is, child rows will be shown). -}; + interface [ + GenerateConstructor + ] HTMLDataGridRowElement : HTMLElement { + attribute boolean selected; // Whether or not the row is currently selected. + attribute boolean focused; // Whether or not the row is the current object in the tree for keyboard navigation (or as the principal item of a multiple selection). + + attribute boolean expanded; // Whether or not the row is open (if it is, child rows will be shown). + }; } diff --git a/src/3rdparty/webkit/WebCore/html/HTMLLinkElement.cpp b/src/3rdparty/webkit/WebCore/html/HTMLLinkElement.cpp index 76a9703..cb8f36c 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLLinkElement.cpp +++ b/src/3rdparty/webkit/WebCore/html/HTMLLinkElement.cpp @@ -225,11 +225,11 @@ void HTMLLinkElement::removedFromDocument() { HTMLElement::removedFromDocument(); + document()->removeStyleSheetCandidateNode(this); + // FIXME: It's terrible to do a synchronous update of the style selector just because a <style> or <link> element got removed. - if (document()->renderer()) { - document()->removeStyleSheetCandidateNode(this); + if (document()->renderer()) document()->updateStyleSelector(); - } } void HTMLLinkElement::finishParsingChildren() diff --git a/src/3rdparty/webkit/WebCore/html/HTMLMediaElement.cpp b/src/3rdparty/webkit/WebCore/html/HTMLMediaElement.cpp index 9789a82..3d48b82 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLMediaElement.cpp +++ b/src/3rdparty/webkit/WebCore/html/HTMLMediaElement.cpp @@ -1610,8 +1610,7 @@ bool HTMLMediaElement::processingUserGesture() const void HTMLMediaElement::deliverNotification(MediaPlayerProxyNotificationType notification) { if (notification == MediaPlayerNotificationPlayPauseButtonPressed) { - ExceptionCode ec; - togglePlayState(ec); + togglePlayState(); return; } @@ -1630,7 +1629,7 @@ String HTMLMediaElement::initialURL() KURL initialSrc = document()->completeURL(getAttribute(srcAttr)); if (!initialSrc.isValid()) - initialSrc = selectNextSourceChild(0, DoNothing).string(); + initialSrc = selectNextSourceChild(0, DoNothing); m_currentSrc = initialSrc.string(); diff --git a/src/3rdparty/webkit/WebCore/html/HTMLMediaElement.h b/src/3rdparty/webkit/WebCore/html/HTMLMediaElement.h index f85700c..8d238d5 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLMediaElement.h +++ b/src/3rdparty/webkit/WebCore/html/HTMLMediaElement.h @@ -65,7 +65,9 @@ public: virtual bool isVideo() const { return false; } virtual bool hasVideo() const { return false; } - + + virtual bool supportsFullscreen() const { return false; } + void scheduleLoad(); virtual void defaultEventHandler(Event*); diff --git a/src/3rdparty/webkit/WebCore/html/HTMLSelectElement.cpp b/src/3rdparty/webkit/WebCore/html/HTMLSelectElement.cpp index 95038e6..c47bb70 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLSelectElement.cpp +++ b/src/3rdparty/webkit/WebCore/html/HTMLSelectElement.cpp @@ -80,9 +80,14 @@ void HTMLSelectElement::deselectItems(HTMLOptionElement* excludeElement) SelectElement::deselectItems(m_data, this, excludeElement); } -void HTMLSelectElement::setSelectedIndex(int optionIndex, bool deselect, bool fireOnChange) +void HTMLSelectElement::setSelectedIndex(int optionIndex, bool deselect) { - SelectElement::setSelectedIndex(m_data, this, optionIndex, deselect, fireOnChange); + SelectElement::setSelectedIndex(m_data, this, optionIndex, deselect, false, false); +} + +void HTMLSelectElement::setSelectedIndexByUser(int optionIndex, bool deselect, bool fireOnChangeNow) +{ + SelectElement::setSelectedIndex(m_data, this, optionIndex, deselect, fireOnChangeNow, true); } int HTMLSelectElement::activeSelectionStartListIndex() const diff --git a/src/3rdparty/webkit/WebCore/html/HTMLSelectElement.h b/src/3rdparty/webkit/WebCore/html/HTMLSelectElement.h index b00d68f..e523641 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLSelectElement.h +++ b/src/3rdparty/webkit/WebCore/html/HTMLSelectElement.h @@ -39,7 +39,8 @@ public: HTMLSelectElement(const QualifiedName&, Document*, HTMLFormElement* = 0); virtual int selectedIndex() const; - virtual void setSelectedIndex(int index, bool deselect = true, bool fireOnChange = false); + virtual void setSelectedIndex(int index, bool deselect = true); + virtual void setSelectedIndexByUser(int index, bool deselect = true, bool fireOnChangeNow = false); unsigned length() const; diff --git a/src/3rdparty/webkit/WebCore/html/HTMLStyleElement.cpp b/src/3rdparty/webkit/WebCore/html/HTMLStyleElement.cpp index f6b5924..206aec4 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLStyleElement.cpp +++ b/src/3rdparty/webkit/WebCore/html/HTMLStyleElement.cpp @@ -71,8 +71,7 @@ void HTMLStyleElement::insertedIntoDocument() void HTMLStyleElement::removedFromDocument() { HTMLElement::removedFromDocument(); - if (document()->renderer()) - document()->removeStyleSheetCandidateNode(this); + document()->removeStyleSheetCandidateNode(this); StyleElement::removedFromDocument(document()); } diff --git a/src/3rdparty/webkit/WebCore/html/HTMLTokenizer.cpp b/src/3rdparty/webkit/WebCore/html/HTMLTokenizer.cpp index 0fd503c..6966351 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLTokenizer.cpp +++ b/src/3rdparty/webkit/WebCore/html/HTMLTokenizer.cpp @@ -437,14 +437,11 @@ HTMLTokenizer::State HTMLTokenizer::scriptHandler(State state) if (!m_doc->ownerElement()) printf("Requesting script at time %d\n", m_doc->elapsedTime()); #endif - if (m_XSSAuditor && m_XSSAuditor->canLoadExternalScriptFromSrc(m_scriptTagSrcAttrValue)) { - // The parser might have been stopped by for example a window.close call in an earlier script. - // If so, we don't want to load scripts. - if (!m_parserStopped && (cs = m_doc->docLoader()->requestScript(m_scriptTagSrcAttrValue, m_scriptTagCharsetAttrValue))) - m_pendingScripts.append(cs); - else - m_scriptNode = 0; - } else + // The parser might have been stopped by for example a window.close call in an earlier script. + // If so, we don't want to load scripts. + if (!m_parserStopped && (cs = m_doc->docLoader()->requestScript(m_scriptTagSrcAttrValue, m_scriptTagCharsetAttrValue))) + m_pendingScripts.append(cs); + else m_scriptNode = 0; } else m_scriptNode = 0; @@ -1476,8 +1473,11 @@ HTMLTokenizer::State HTMLTokenizer::parseTag(SegmentedString& src, State state) m_scriptTagCharsetAttrValue = String(); if (m_currentToken.attrs && !m_fragment) { if (m_doc->frame() && m_doc->frame()->script()->isEnabled()) { - if ((a = m_currentToken.attrs->getAttributeItem(srcAttr))) + if ((a = m_currentToken.attrs->getAttributeItem(srcAttr))) { m_scriptTagSrcAttrValue = m_doc->completeURL(parseURL(a->value())).string(); + if (m_XSSAuditor && !m_XSSAuditor->canLoadExternalScriptFromSrc(a->value())) + m_scriptTagSrcAttrValue = String(); + } } } } diff --git a/src/3rdparty/webkit/WebCore/html/HTMLVideoElement.h b/src/3rdparty/webkit/WebCore/html/HTMLVideoElement.h index 5b59edb..830e72e 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLVideoElement.h +++ b/src/3rdparty/webkit/WebCore/html/HTMLVideoElement.h @@ -50,6 +50,7 @@ public: virtual void parseMappedAttribute(MappedAttribute* attr); virtual bool isVideo() const { return true; } virtual bool hasVideo() const { return player() && player()->hasVideo(); } + virtual bool supportsFullscreen() const { return player() && player()->supportsFullscreen(); } virtual bool isURLAttribute(Attribute*) const; virtual const QualifiedName& imageSourceAttributeName() const; diff --git a/src/3rdparty/webkit/WebCore/html/HTMLViewSourceDocument.cpp b/src/3rdparty/webkit/WebCore/html/HTMLViewSourceDocument.cpp index d4d6df7..13404cc 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLViewSourceDocument.cpp +++ b/src/3rdparty/webkit/WebCore/html/HTMLViewSourceDocument.cpp @@ -56,9 +56,16 @@ HTMLViewSourceDocument::HTMLViewSourceDocument(Frame* frame, const String& mimeT Tokenizer* HTMLViewSourceDocument::createTokenizer() { - if (implementation()->isTextMIMEType(m_type)) - return createTextTokenizer(this); - return new HTMLTokenizer(this); + // Use HTMLTokenizer if applicable, otherwise use TextTokenizer. + if (m_type == "text/html" || m_type == "application/xhtml+xml" || m_type == "image/svg+xml" || implementation()->isXMLMIMEType(m_type) +#if ENABLE(XHTMLMP) + || m_type == "application/vnd.wap.xhtml+xml" +#endif + ) { + return new HTMLTokenizer(this); + } + + return createTextTokenizer(this); } void HTMLViewSourceDocument::createContainingTable() diff --git a/src/3rdparty/webkit/WebCore/html/HTMLViewSourceDocument.h b/src/3rdparty/webkit/WebCore/html/HTMLViewSourceDocument.h index 4e725c7..57a8f21 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLViewSourceDocument.h +++ b/src/3rdparty/webkit/WebCore/html/HTMLViewSourceDocument.h @@ -38,9 +38,10 @@ public: { return new HTMLViewSourceDocument(frame, mimeType); } - + + // Returns HTMLTokenizer or TextTokenizer based on m_type. virtual Tokenizer* createTokenizer(); - + void addViewSourceToken(Token*); // Used by the HTML tokenizer. void addViewSourceText(const String&); // Used by the plaintext tokenizer. void addViewSourceDoctypeToken(DoctypeToken*); |