From 5f1ab04193ad0130ca8204aadaceae083aca9881 Mon Sep 17 00:00:00 2001 From: Feng Qian Date: Wed, 17 Jun 2009 12:12:20 -0700 Subject: Get WebKit r44544. --- WebCore/html/CanvasPixelArray.idl | 2 +- WebCore/html/CanvasRenderingContext2D.cpp | 10 +- WebCore/html/CanvasStyle.cpp | 2 - WebCore/html/CollectionCache.cpp | 88 ++++ WebCore/html/CollectionCache.h | 64 +++ WebCore/html/CollectionType.h | 67 +++ WebCore/html/HTMLAnchorElement.cpp | 17 +- WebCore/html/HTMLAnchorElement.idl | 4 +- WebCore/html/HTMLAppletElement.cpp | 3 +- WebCore/html/HTMLAppletElement.idl | 4 +- WebCore/html/HTMLAreaElement.cpp | 1 + WebCore/html/HTMLAreaElement.idl | 2 +- WebCore/html/HTMLAttributeNames.in | 4 + WebCore/html/HTMLBRElement.cpp | 2 + WebCore/html/HTMLBaseElement.cpp | 1 + WebCore/html/HTMLBaseFontElement.idl | 2 +- WebCore/html/HTMLBodyElement.cpp | 65 ++- WebCore/html/HTMLBodyElement.h | 15 +- WebCore/html/HTMLBodyElement.idl | 6 - WebCore/html/HTMLButtonElement.cpp | 8 +- WebCore/html/HTMLButtonElement.h | 2 +- WebCore/html/HTMLCanvasElement.cpp | 9 +- WebCore/html/HTMLCanvasElement.h | 5 +- WebCore/html/HTMLCanvasElement.idl | 2 +- WebCore/html/HTMLCollection.cpp | 74 +-- WebCore/html/HTMLCollection.h | 90 +--- WebCore/html/HTMLCollection.idl | 3 +- WebCore/html/HTMLDivElement.cpp | 2 + WebCore/html/HTMLDocument.idl | 2 +- WebCore/html/HTMLElement.cpp | 99 ++-- WebCore/html/HTMLElement.idl | 4 +- WebCore/html/HTMLElementsAllInOne.cpp | 101 ++++ WebCore/html/HTMLEmbedElement.cpp | 12 +- WebCore/html/HTMLEmbedElement.idl | 10 +- WebCore/html/HTMLFieldSetElement.cpp | 2 +- WebCore/html/HTMLFieldSetElement.h | 2 +- WebCore/html/HTMLFontElement.cpp | 1 + WebCore/html/HTMLFormCollection.cpp | 7 +- WebCore/html/HTMLFormCollection.h | 2 +- WebCore/html/HTMLFormControlElement.cpp | 25 +- WebCore/html/HTMLFormControlElement.h | 30 +- WebCore/html/HTMLFormElement.cpp | 159 +++--- WebCore/html/HTMLFormElement.h | 25 +- WebCore/html/HTMLFrameElement.cpp | 5 +- WebCore/html/HTMLFrameElement.h | 5 +- WebCore/html/HTMLFrameElement.idl | 6 +- WebCore/html/HTMLFrameElementBase.cpp | 10 +- WebCore/html/HTMLFrameElementBase.h | 2 +- WebCore/html/HTMLFrameOwnerElement.cpp | 3 +- WebCore/html/HTMLFrameOwnerElement.h | 5 +- WebCore/html/HTMLFrameSetElement.cpp | 17 +- WebCore/html/HTMLHRElement.cpp | 2 + WebCore/html/HTMLHtmlElement.cpp | 4 +- WebCore/html/HTMLIFrameElement.cpp | 5 +- WebCore/html/HTMLIFrameElement.h | 2 +- WebCore/html/HTMLIFrameElement.idl | 6 +- WebCore/html/HTMLImageElement.cpp | 6 +- WebCore/html/HTMLImageElement.idl | 2 +- WebCore/html/HTMLImageLoader.cpp | 15 +- WebCore/html/HTMLInputElement.cpp | 164 ++++-- WebCore/html/HTMLInputElement.h | 31 +- WebCore/html/HTMLInputElement.idl | 5 +- WebCore/html/HTMLIsIndexElement.cpp | 4 + WebCore/html/HTMLKeygenElement.cpp | 3 +- WebCore/html/HTMLKeygenElement.h | 2 +- WebCore/html/HTMLLIElement.cpp | 1 + WebCore/html/HTMLLegendElement.cpp | 2 +- WebCore/html/HTMLLegendElement.h | 2 +- WebCore/html/HTMLLinkElement.cpp | 49 +- WebCore/html/HTMLLinkElement.idl | 4 +- WebCore/html/HTMLMapElement.cpp | 6 +- WebCore/html/HTMLMarqueeElement.cpp | 20 + WebCore/html/HTMLMarqueeElement.h | 8 +- WebCore/html/HTMLMediaElement.cpp | 286 ++++++---- WebCore/html/HTMLMediaElement.h | 23 +- WebCore/html/HTMLMediaElement.idl | 2 + WebCore/html/HTMLMetaElement.cpp | 2 + WebCore/html/HTMLNameCollection.cpp | 2 +- WebCore/html/HTMLNameCollection.h | 4 +- WebCore/html/HTMLNoScriptElement.cpp | 85 +++ WebCore/html/HTMLNoScriptElement.h | 46 ++ WebCore/html/HTMLOListElement.cpp | 2 + WebCore/html/HTMLObjectElement.cpp | 11 +- WebCore/html/HTMLObjectElement.idl | 8 +- WebCore/html/HTMLOptGroupElement.cpp | 2 +- WebCore/html/HTMLOptGroupElement.h | 2 +- WebCore/html/HTMLOptionElement.cpp | 33 +- WebCore/html/HTMLOptionElement.h | 4 +- WebCore/html/HTMLOptionElement.idl | 2 +- WebCore/html/HTMLOptionsCollection.idl | 2 +- WebCore/html/HTMLParagraphElement.cpp | 2 + WebCore/html/HTMLParamElement.cpp | 1 + WebCore/html/HTMLParser.cpp | 86 ++- WebCore/html/HTMLParser.h | 14 +- WebCore/html/HTMLParserQuirks.h | 49 ++ WebCore/html/HTMLPlugInElement.cpp | 4 +- WebCore/html/HTMLPreElement.cpp | 2 + WebCore/html/HTMLScriptElement.cpp | 13 +- WebCore/html/HTMLScriptElement.h | 5 +- WebCore/html/HTMLSelectElement.cpp | 836 +++--------------------------- WebCore/html/HTMLSelectElement.h | 168 +++--- WebCore/html/HTMLSelectElement.idl | 4 +- WebCore/html/HTMLSourceElement.cpp | 20 + WebCore/html/HTMLSourceElement.h | 9 + WebCore/html/HTMLStyleElement.cpp | 2 + WebCore/html/HTMLStyleElement.idl | 2 +- WebCore/html/HTMLTableCaptionElement.cpp | 2 + WebCore/html/HTMLTableCellElement.cpp | 2 + WebCore/html/HTMLTableColElement.cpp | 4 +- WebCore/html/HTMLTableElement.cpp | 9 +- WebCore/html/HTMLTablePartElement.cpp | 2 + WebCore/html/HTMLTableRowElement.cpp | 2 +- WebCore/html/HTMLTableRowsCollection.cpp | 2 +- WebCore/html/HTMLTableSectionElement.cpp | 2 +- WebCore/html/HTMLTagNames.in | 20 +- WebCore/html/HTMLTextAreaElement.cpp | 30 +- WebCore/html/HTMLTextAreaElement.h | 10 +- WebCore/html/HTMLTokenizer.cpp | 42 +- WebCore/html/HTMLUListElement.cpp | 2 + WebCore/html/HTMLVideoElement.cpp | 1 + WebCore/html/HTMLViewSourceDocument.cpp | 20 +- WebCore/html/ImageData.idl | 2 +- WebCore/html/MediaError.h | 2 +- WebCore/html/MediaError.idl | 2 +- WebCore/html/PreloadScanner.cpp | 7 +- WebCore/html/TimeRanges.cpp | 56 +- WebCore/html/TimeRanges.h | 40 +- 127 files changed, 1814 insertions(+), 1609 deletions(-) create mode 100644 WebCore/html/CollectionCache.cpp create mode 100644 WebCore/html/CollectionCache.h create mode 100644 WebCore/html/CollectionType.h create mode 100644 WebCore/html/HTMLElementsAllInOne.cpp create mode 100644 WebCore/html/HTMLNoScriptElement.cpp create mode 100644 WebCore/html/HTMLNoScriptElement.h create mode 100644 WebCore/html/HTMLParserQuirks.h (limited to 'WebCore/html') diff --git a/WebCore/html/CanvasPixelArray.idl b/WebCore/html/CanvasPixelArray.idl index 9b333e4..c815788 100644 --- a/WebCore/html/CanvasPixelArray.idl +++ b/WebCore/html/CanvasPixelArray.idl @@ -27,7 +27,7 @@ */ module html { -#if !defined(LANGUAGE_JAVASCRIPT) || defined(V8_BINDING) +#if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT || defined(V8_BINDING) && V8_BINDING interface [ CustomHeader, HasCustomIndexGetter, diff --git a/WebCore/html/CanvasRenderingContext2D.cpp b/WebCore/html/CanvasRenderingContext2D.cpp index 82680bd..f2541ed 100644 --- a/WebCore/html/CanvasRenderingContext2D.cpp +++ b/WebCore/html/CanvasRenderingContext2D.cpp @@ -36,6 +36,7 @@ #include "CanvasGradient.h" #include "CanvasPattern.h" #include "CanvasStyle.h" +#include "CSSMutableStyleDeclaration.h" #include "CSSPropertyNames.h" #include "CSSStyleSelector.h" #include "Document.h" @@ -49,7 +50,6 @@ #include "ImageBuffer.h" #include "ImageData.h" #include "KURL.h" -#include "NotImplemented.h" #include "Page.h" #include "RenderHTMLCanvas.h" #include "SecurityOrigin.h" @@ -60,6 +60,7 @@ #include #include +#include using namespace std; @@ -95,6 +96,9 @@ CanvasRenderingContext2D::CanvasRenderingContext2D(HTMLCanvasElement* canvas) : m_canvas(canvas) , m_stateStack(1) { + // Make sure that even if the drawingContext() has a different default + // thickness, it is in sync with the canvas thickness. + setLineWidth(lineWidth()); } void CanvasRenderingContext2D::ref() @@ -1442,8 +1446,8 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo // FIXME: The rect is not big enough for miters on stroked text. IntRect maskRect = enclosingIntRect(textRect); - auto_ptr maskImage = ImageBuffer::create(maskRect.size(), false); - + OwnPtr maskImage = ImageBuffer::create(maskRect.size(), false); + GraphicsContext* maskImageContext = maskImage->context(); if (fill) diff --git a/WebCore/html/CanvasStyle.cpp b/WebCore/html/CanvasStyle.cpp index 0aaaab2..37308ad 100644 --- a/WebCore/html/CanvasStyle.cpp +++ b/WebCore/html/CanvasStyle.cpp @@ -44,8 +44,6 @@ #include #include #include -#elif PLATFORM(CAIRO) -#include "NotImplemented.h" #endif namespace WebCore { diff --git a/WebCore/html/CollectionCache.cpp b/WebCore/html/CollectionCache.cpp new file mode 100644 index 0000000..feecd96 --- /dev/null +++ b/WebCore/html/CollectionCache.cpp @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. + * + * 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 "CollectionCache.h" + +namespace WebCore { + +CollectionCache::CollectionCache() + : version(0) +{ + reset(); +} + +inline void CollectionCache::copyCacheMap(NodeCacheMap& dest, const NodeCacheMap& src) +{ + ASSERT(dest.isEmpty()); + NodeCacheMap::const_iterator end = src.end(); + for (NodeCacheMap::const_iterator it = src.begin(); it != end; ++it) + dest.add(it->first, new Vector(*it->second)); +} + +CollectionCache::CollectionCache(const CollectionCache& other) + : version(other.version) + , current(other.current) + , position(other.position) + , length(other.length) + , elementsArrayPosition(other.elementsArrayPosition) + , hasLength(other.hasLength) + , hasNameCache(other.hasNameCache) +{ + copyCacheMap(idCache, other.idCache); + copyCacheMap(nameCache, other.nameCache); +} + +void CollectionCache::swap(CollectionCache& other) +{ + std::swap(version, other.version); + std::swap(current, other.current); + std::swap(position, other.position); + std::swap(length, other.length); + std::swap(elementsArrayPosition, other.elementsArrayPosition); + + idCache.swap(other.idCache); + nameCache.swap(other.nameCache); + + std::swap(hasLength, other.hasLength); + std::swap(hasNameCache, other.hasNameCache); +} + +CollectionCache::~CollectionCache() +{ + deleteAllValues(idCache); + deleteAllValues(nameCache); +} + +void CollectionCache::reset() +{ + current = 0; + position = 0; + length = 0; + hasLength = false; + elementsArrayPosition = 0; + deleteAllValues(idCache); + idCache.clear(); + deleteAllValues(nameCache); + nameCache.clear(); + hasNameCache = false; +} + +} // namespace WebCore diff --git a/WebCore/html/CollectionCache.h b/WebCore/html/CollectionCache.h new file mode 100644 index 0000000..7cdcdd5 --- /dev/null +++ b/WebCore/html/CollectionCache.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. + * + * 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. + * + */ + +#ifndef CollectionCache_h +#define CollectionCache_h + +#include +#include + +namespace WebCore { + +class AtomicStringImpl; +class Element; + +struct CollectionCache { + CollectionCache(); + CollectionCache(const CollectionCache&); + CollectionCache& operator=(const CollectionCache& other) + { + CollectionCache tmp(other); + swap(tmp); + return *this; + } + ~CollectionCache(); + + void reset(); + void swap(CollectionCache&); + + typedef HashMap*> NodeCacheMap; + + unsigned version; + Element* current; + unsigned position; + unsigned length; + int elementsArrayPosition; + NodeCacheMap idCache; + NodeCacheMap nameCache; + bool hasLength; + bool hasNameCache; + +private: + static void copyCacheMap(NodeCacheMap&, const NodeCacheMap&); +}; + +} // namespace + +#endif diff --git a/WebCore/html/CollectionType.h b/WebCore/html/CollectionType.h new file mode 100644 index 0000000..e5973a3 --- /dev/null +++ b/WebCore/html/CollectionType.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 1999 Lars Knoll (knoll@kde.org) + * (C) 1999 Antti Koivisto (koivisto@kde.org) + * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. + * + * 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. + * + */ + +#ifndef CollectionType_h +#define CollectionType_h + +namespace WebCore { + +enum CollectionType { + // unnamed collection types cached in the document + + DocImages, // all elements in the document + DocApplets, // all and elements + DocEmbeds, // all elements + DocObjects, // all elements + DocForms, // all
elements + DocLinks, // all _and_ elements with a value for href + DocAnchors, // all elements with a value for name + DocScripts, // all