From 8f72e70a9fd78eec56623b3a62e68f16b7b27e28 Mon Sep 17 00:00:00 2001 From: Feng Qian <> Date: Fri, 10 Apr 2009 18:11:29 -0700 Subject: AI 145796: Land the WebKit merge @r42026. Automated import of CL 145796 --- WebCore/html/CanvasGradient.cpp | 5 +- WebCore/html/CanvasGradient.h | 5 + WebCore/html/CanvasRenderingContext2D.cpp | 26 +- WebCore/html/CanvasRenderingContext2D.h | 3 +- WebCore/html/CanvasStyle.cpp | 19 +- WebCore/html/HTMLAnchorElement.cpp | 21 +- WebCore/html/HTMLAppletElement.cpp | 13 +- WebCore/html/HTMLAreaElement.cpp | 31 +- WebCore/html/HTMLAreaElement.h | 27 +- WebCore/html/HTMLCanvasElement.cpp | 2 +- WebCore/html/HTMLCanvasElement.idl | 2 +- WebCore/html/HTMLDocument.cpp | 8 +- WebCore/html/HTMLDocument.h | 1 + WebCore/html/HTMLElement.cpp | 31 +- WebCore/html/HTMLElement.h | 2 - WebCore/html/HTMLElementFactory.cpp | 510 ------------ WebCore/html/HTMLElementFactory.h | 47 -- WebCore/html/HTMLEmbedElement.cpp | 4 +- WebCore/html/HTMLFormControlElement.cpp | 7 +- WebCore/html/HTMLFormControlElement.h | 2 +- WebCore/html/HTMLFormElement.cpp | 22 +- WebCore/html/HTMLImageElement.cpp | 4 +- WebCore/html/HTMLImageLoader.cpp | 5 +- WebCore/html/HTMLInputElement.cpp | 103 +-- WebCore/html/HTMLInputElement.h | 9 +- WebCore/html/HTMLInputElement.idl | 8 +- WebCore/html/HTMLLegendElement.cpp | 9 - WebCore/html/HTMLLegendElement.h | 1 - WebCore/html/HTMLMediaElement.cpp | 1282 +++++++++++++++++++---------- WebCore/html/HTMLMediaElement.h | 184 +++-- WebCore/html/HTMLMediaElement.idl | 44 +- WebCore/html/HTMLObjectElement.cpp | 11 +- WebCore/html/HTMLOptGroupElement.cpp | 10 - WebCore/html/HTMLOptionElement.cpp | 11 +- WebCore/html/HTMLOptionElement.h | 2 +- WebCore/html/HTMLParser.cpp | 374 +++++---- WebCore/html/HTMLParser.h | 23 +- WebCore/html/HTMLQuoteElement.cpp | 8 + WebCore/html/HTMLQuoteElement.h | 2 + WebCore/html/HTMLSelectElement.cpp | 109 +-- WebCore/html/HTMLSelectElement.h | 5 - WebCore/html/HTMLSourceElement.cpp | 2 +- WebCore/html/HTMLTagNames.in | 2 +- WebCore/html/HTMLTextAreaElement.cpp | 31 +- WebCore/html/HTMLTextAreaElement.h | 4 +- WebCore/html/HTMLTokenizer.cpp | 30 +- WebCore/html/HTMLTokenizer.h | 2 +- WebCore/html/HTMLVideoElement.cpp | 22 +- WebCore/html/HTMLVideoElement.h | 3 + WebCore/html/HTMLViewSourceDocument.cpp | 14 +- WebCore/html/MediaError.h | 2 +- WebCore/html/MediaError.idl | 1 + WebCore/html/PreloadScanner.cpp | 7 +- 53 files changed, 1528 insertions(+), 1584 deletions(-) delete mode 100644 WebCore/html/HTMLElementFactory.cpp delete mode 100644 WebCore/html/HTMLElementFactory.h (limited to 'WebCore/html') diff --git a/WebCore/html/CanvasGradient.cpp b/WebCore/html/CanvasGradient.cpp index 693d8f7..fd48194 100644 --- a/WebCore/html/CanvasGradient.cpp +++ b/WebCore/html/CanvasGradient.cpp @@ -34,11 +34,13 @@ namespace WebCore { CanvasGradient::CanvasGradient(const FloatPoint& p0, const FloatPoint& p1) : m_gradient(Gradient::create(p0, p1)) + , m_dashbardCompatibilityMode(false) { } CanvasGradient::CanvasGradient(const FloatPoint& p0, float r0, const FloatPoint& p1, float r1) : m_gradient(Gradient::create(p0, r0, p1, r1)) + , m_dashbardCompatibilityMode(false) { } @@ -51,7 +53,8 @@ void CanvasGradient::addColorStop(float value, const String& color, ExceptionCod RGBA32 rgba = 0; if (!CSSParser::parseColor(rgba, color)) { - ec = SYNTAX_ERR; + if (!m_dashbardCompatibilityMode) + ec = SYNTAX_ERR; return; } diff --git a/WebCore/html/CanvasGradient.h b/WebCore/html/CanvasGradient.h index 3b81dbd..0a77652 100644 --- a/WebCore/html/CanvasGradient.h +++ b/WebCore/html/CanvasGradient.h @@ -54,11 +54,16 @@ namespace WebCore { void getColor(float value, float* r, float* g, float* b, float* a) const { m_gradient->getColor(value, r, g, b, a); } +#if ENABLE(DASHBOARD_SUPPORT) + void setDashboardCompatibilityMode() { m_dashbardCompatibilityMode = true; } +#endif + private: CanvasGradient(const FloatPoint& p0, const FloatPoint& p1); CanvasGradient(const FloatPoint& p0, float r0, const FloatPoint& p1, float r1); RefPtr m_gradient; + bool m_dashbardCompatibilityMode; }; } //namespace diff --git a/WebCore/html/CanvasRenderingContext2D.cpp b/WebCore/html/CanvasRenderingContext2D.cpp index 373301a..82680bd 100644 --- a/WebCore/html/CanvasRenderingContext2D.cpp +++ b/WebCore/html/CanvasRenderingContext2D.cpp @@ -357,7 +357,7 @@ void CanvasRenderingContext2D::scale(float sx, float sy) return; TransformationMatrix newTransform = state().m_transform; - newTransform.scale(sx, sy); + newTransform.scaleNonUniform(sx, sy); if (!newTransform.isInvertible()) { state().m_invertibleCTM = false; return; @@ -365,7 +365,7 @@ void CanvasRenderingContext2D::scale(float sx, float sy) state().m_transform = newTransform; c->scale(FloatSize(sx, sy)); - m_path.transform(TransformationMatrix().scale(1.0/sx, 1.0/sy)); + m_path.transform(TransformationMatrix().scaleNonUniform(1.0/sx, 1.0/sy)); } void CanvasRenderingContext2D::rotate(float angleInRadians) @@ -867,7 +867,6 @@ void CanvasRenderingContext2D::setShadow(float width, float height, float blur, GraphicsContext* dc = drawingContext(); if (!dc) return; - // FIXME: Do this through platform-independent GraphicsContext API. #if PLATFORM(CG) const CGFloat components[5] = { c, m, y, k, a }; CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceCMYK(); @@ -875,6 +874,8 @@ void CanvasRenderingContext2D::setShadow(float width, float height, float blur, CGColorSpaceRelease(colorSpace); CGContextSetShadowWithColor(dc->platformContext(), adjustedShadowSize(width, -height), blur, shadowColor); CGColorRelease(shadowColor); +#else + dc->setShadow(IntSize(width, -height), blur, Color(c, m, y, k, a)); #endif } @@ -1078,6 +1079,15 @@ void CanvasRenderingContext2D::setCompositeOperation(const String& operation) setGlobalCompositeOperation(operation); } +void CanvasRenderingContext2D::prepareGradientForDashboard(CanvasGradient* gradient) const +{ +#if ENABLE(DASHBOARD_SUPPORT) + if (Settings* settings = m_canvas->document()->settings()) + if (settings->usesDashboardBackwardCompatibilityMode()) + gradient->setDashboardCompatibilityMode(); +#endif +} + PassRefPtr CanvasRenderingContext2D::createLinearGradient(float x0, float y0, float x1, float y1, ExceptionCode& ec) { if (!isfinite(x0) || !isfinite(y0) || !isfinite(x1) || !isfinite(y1)) { @@ -1085,7 +1095,9 @@ PassRefPtr CanvasRenderingContext2D::createLinearGradient(float return 0; } - return CanvasGradient::create(FloatPoint(x0, y0), FloatPoint(x1, y1)); + PassRefPtr gradient = CanvasGradient::create(FloatPoint(x0, y0), FloatPoint(x1, y1)); + prepareGradientForDashboard(gradient.get()); + return gradient; } PassRefPtr CanvasRenderingContext2D::createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, ExceptionCode& ec) @@ -1095,7 +1107,9 @@ PassRefPtr CanvasRenderingContext2D::createRadialGradient(float ec = NOT_SUPPORTED_ERR; return 0; } - return CanvasGradient::create(FloatPoint(x0, y0), r0, FloatPoint(x1, y1), r1); + PassRefPtr gradient = CanvasGradient::create(FloatPoint(x0, y0), r0, FloatPoint(x1, y1), r1); + prepareGradientForDashboard(gradient.get()); + return gradient; } PassRefPtr CanvasRenderingContext2D::createPattern(HTMLImageElement* image, @@ -1422,6 +1436,7 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo m_canvas->willDraw(FloatRect(0, 0, m_canvas->width(), m_canvas->height())); } +#if PLATFORM(CG) CanvasStyle* drawStyle = fill ? state().m_fillStyle.get() : state().m_strokeStyle.get(); if (drawStyle->canvasGradient() || drawStyle->canvasPattern()) { // FIXME: The rect is not big enough for miters on stroked text. @@ -1451,6 +1466,7 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo return; } +#endif c->setTextDrawingMode(fill ? cTextFill : cTextStroke); c->drawBidiText(font, textRun, location); diff --git a/WebCore/html/CanvasRenderingContext2D.h b/WebCore/html/CanvasRenderingContext2D.h index 8d05b92..d74659e 100644 --- a/WebCore/html/CanvasRenderingContext2D.h +++ b/WebCore/html/CanvasRenderingContext2D.h @@ -251,7 +251,8 @@ namespace WebCore { #if ENABLE(DASHBOARD_SUPPORT) void clearPathForDashboardBackwardCompatibilityMode(); #endif - + + void prepareGradientForDashboard(CanvasGradient* gradient) const; void checkOrigin(const KURL&); HTMLCanvasElement* m_canvas; diff --git a/WebCore/html/CanvasStyle.cpp b/WebCore/html/CanvasStyle.cpp index d82643f..0aaaab2 100644 --- a/WebCore/html/CanvasStyle.cpp +++ b/WebCore/html/CanvasStyle.cpp @@ -78,12 +78,21 @@ CanvasStyle::CanvasStyle(float grayLevel, float alpha) } CanvasStyle::CanvasStyle(float r, float g, float b, float a) - : m_type(RGBA), m_alpha(a), m_red(r), m_green(g), m_blue(b) + : m_type(RGBA) + , m_alpha(a) + , m_red(r) + , m_green(g) + , m_blue(b) { } CanvasStyle::CanvasStyle(float c, float m, float y, float k, float a) - : m_type(CMYKA), m_alpha(a), m_cyan(c), m_magenta(m), m_yellow(y), m_black(k) + : m_type(CMYKA) + , m_alpha(a) + , m_cyan(c) + , m_magenta(m) + , m_yellow(y) + , m_black(k) { } @@ -146,10 +155,10 @@ void CanvasStyle::applyStrokeColor(GraphicsContext* context) clr.setCmykF(m_cyan, m_magenta, m_yellow, m_black, m_alpha); currentPen.setColor(clr); context->platformContext()->setPen(currentPen); -#elif PLATFORM(CAIRO) - notImplemented(); #elif PLATFORM(SGL) context->setCMYKAStrokeColor(m_cyan, m_magenta, m_yellow, m_black, m_alpha); +#else + context->setStrokeColor(Color(m_cyan, m_magenta, m_yellow, m_black, m_alpha)); #endif break; } @@ -211,6 +220,8 @@ void CanvasStyle::applyFillColor(GraphicsContext* context) context->platformContext()->setBrush(currentBrush); #elif PLATFORM(SGL) context->setCMYKAFillColor(m_cyan, m_magenta, m_yellow, m_black, m_alpha); +#else + context->setFillColor(Color(m_cyan, m_magenta, m_yellow, m_black, m_alpha)); #endif break; } diff --git a/WebCore/html/HTMLAnchorElement.cpp b/WebCore/html/HTMLAnchorElement.cpp index 4122168..c6b2a95 100644 --- a/WebCore/html/HTMLAnchorElement.cpp +++ b/WebCore/html/HTMLAnchorElement.cpp @@ -38,7 +38,8 @@ #include "KeyboardEvent.h" #include "MouseEvent.h" #include "MutationEvent.h" -#include "RenderFlow.h" +#include "Page.h" +#include "RenderBox.h" #include "RenderImage.h" #include "ResourceRequest.h" #include "SelectionController.h" @@ -107,18 +108,14 @@ bool HTMLAnchorElement::isKeyboardFocusable(KeyboardEvent* event) const if (!document()->frame()->eventHandler()->tabsToLinks(event)) return false; - if (!renderer() || !renderer()->isBox()) + if (!renderer() || !renderer()->isBoxModelObject()) return false; // Before calling absoluteRects, check for the common case where the renderer - // or one of the continuations is non-empty, since this is a faster check and - // almost always returns true. - RenderBox* box = toRenderBox(renderer()); + // is non-empty, since this is a faster check and almost always returns true. + RenderBoxModelObject* box = toRenderBoxModelObject(renderer()); if (!box->borderBoundingBox().isEmpty()) return true; - for (RenderFlow* r = box->virtualContinuation(); r; r = r->continuation()) - if (!r->borderBoundingBox().isEmpty()) - return true; Vector rects; FloatPoint absPos = renderer()->localToAbsolute(); @@ -203,7 +200,7 @@ void HTMLAnchorElement::defaultEventHandler(Event* evt) if (evt->target()->toNode()->hasTagName(imgTag)) { HTMLImageElement* img = static_cast(evt->target()->toNode()); if (img && img->isServerMap()) { - RenderImage* r = static_cast(img->renderer()); + RenderImage* r = toRenderImage(img->renderer()); if (r && e) { // FIXME: broken with transforms FloatPoint absPos = r->localToAbsolute(); @@ -434,7 +431,8 @@ void HTMLAnchorElement::setType(const AtomicString& value) String HTMLAnchorElement::hash() const { - return "#" + href().ref(); + String ref = href().ref(); + return ref.isEmpty() ? "" : "#" + ref; } String HTMLAnchorElement::host() const @@ -467,7 +465,8 @@ String HTMLAnchorElement::protocol() const String HTMLAnchorElement::search() const { - return href().query(); + String query = href().query(); + return query.isEmpty() ? "" : "?" + query; } String HTMLAnchorElement::text() const diff --git a/WebCore/html/HTMLAppletElement.cpp b/WebCore/html/HTMLAppletElement.cpp index 9d7ab6a..de8e1cf 100644 --- a/WebCore/html/HTMLAppletElement.cpp +++ b/WebCore/html/HTMLAppletElement.cpp @@ -99,9 +99,12 @@ void HTMLAppletElement::removedFromDocument() HTMLPlugInElement::removedFromDocument(); } -bool HTMLAppletElement::rendererIsNeeded(RenderStyle*) +bool HTMLAppletElement::rendererIsNeeded(RenderStyle* style) { - return !getAttribute(codeAttr).isNull(); + if (getAttribute(codeAttr).isNull()) + return false; + + return HTMLPlugInElement::rendererIsNeeded(style); } RenderObject* HTMLAppletElement::createRenderer(RenderArena*, RenderStyle* style) @@ -112,9 +115,13 @@ RenderObject* HTMLAppletElement::createRenderer(RenderArena*, RenderStyle* style HashMap args; args.set("code", getAttribute(codeAttr)); + const AtomicString& codeBase = getAttribute(codebaseAttr); - if(!codeBase.isNull()) + if (!codeBase.isNull()) args.set("codeBase", codeBase); + else + args.set("codeBase", document()->baseURL().baseAsString()); + const AtomicString& name = getAttribute(document()->isHTMLDocument() ? nameAttr : idAttr); if (!name.isNull()) args.set("name", name); diff --git a/WebCore/html/HTMLAreaElement.cpp b/WebCore/html/HTMLAreaElement.cpp index 7a3c9e0..9db50b7 100644 --- a/WebCore/html/HTMLAreaElement.cpp +++ b/WebCore/html/HTMLAreaElement.cpp @@ -1,7 +1,7 @@ /* * Copyright (C) 1999 Lars Knoll (knoll@kde.org) * (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. + * Copyright (C) 2004, 2005, 2006, 2009 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 @@ -27,6 +27,7 @@ #include "HTMLNames.h" #include "HitTestResult.h" #include "Length.h" +#include "Path.h" #include "RenderObject.h" using namespace std; @@ -35,8 +36,8 @@ namespace WebCore { using namespace HTMLNames; -HTMLAreaElement::HTMLAreaElement(const QualifiedName& tagName, Document *doc) - : HTMLAnchorElement(tagName, doc) +HTMLAreaElement::HTMLAreaElement(const QualifiedName& tagName, Document* document) + : HTMLAnchorElement(tagName, document) , m_coords(0) , m_coordsLen(0) , m_lastSize(-1, -1) @@ -73,11 +74,11 @@ void HTMLAreaElement::parseMappedAttribute(MappedAttribute *attr) bool HTMLAreaElement::mapMouseEvent(int x, int y, const IntSize& size, HitTestResult& result) { if (m_lastSize != size) { - region = getRegion(size); + m_region.set(new Path(getRegion(size))); m_lastSize = size; } - if (!region.contains(IntPoint(x, y))) + if (!m_region->contains(IntPoint(x, y))) return false; result.setInnerNode(this); @@ -150,32 +151,32 @@ Path HTMLAreaElement::getRegion(const IntSize& size) const return path; } -String HTMLAreaElement::accessKey() const +const AtomicString& HTMLAreaElement::accessKey() const { return getAttribute(accesskeyAttr); } -void HTMLAreaElement::setAccessKey(const String& value) +void HTMLAreaElement::setAccessKey(const AtomicString& value) { setAttribute(accesskeyAttr, value); } -String HTMLAreaElement::alt() const +const AtomicString& HTMLAreaElement::alt() const { return getAttribute(altAttr); } -void HTMLAreaElement::setAlt(const String& value) +void HTMLAreaElement::setAlt(const AtomicString& value) { setAttribute(altAttr, value); } -String HTMLAreaElement::coords() const +const AtomicString& HTMLAreaElement::coords() const { return getAttribute(coordsAttr); } -void HTMLAreaElement::setCoords(const String& value) +void HTMLAreaElement::setCoords(const AtomicString& value) { setAttribute(coordsAttr, value); } @@ -185,7 +186,7 @@ KURL HTMLAreaElement::href() const return document()->completeURL(getAttribute(hrefAttr)); } -void HTMLAreaElement::setHref(const String& value) +void HTMLAreaElement::setHref(const AtomicString& value) { setAttribute(hrefAttr, value); } @@ -200,12 +201,12 @@ void HTMLAreaElement::setNoHref(bool noHref) setAttribute(nohrefAttr, noHref ? "" : 0); } -String HTMLAreaElement::shape() const +const AtomicString& HTMLAreaElement::shape() const { return getAttribute(shapeAttr); } -void HTMLAreaElement::setShape(const String& value) +void HTMLAreaElement::setShape(const AtomicString& value) { setAttribute(shapeAttr, value); } @@ -220,7 +221,7 @@ String HTMLAreaElement::target() const return getAttribute(targetAttr); } -void HTMLAreaElement::setTarget(const String& value) +void HTMLAreaElement::setTarget(const AtomicString& value) { setAttribute(targetAttr, value); } diff --git a/WebCore/html/HTMLAreaElement.h b/WebCore/html/HTMLAreaElement.h index 7de5832..19533b1 100644 --- a/WebCore/html/HTMLAreaElement.h +++ b/WebCore/html/HTMLAreaElement.h @@ -1,7 +1,7 @@ /* * Copyright (C) 1999 Lars Knoll (knoll@kde.org) * (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2004, 2008, 2009 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 @@ -25,11 +25,11 @@ #include "HTMLAnchorElement.h" #include "IntSize.h" -#include "Path.h" namespace WebCore { class HitTestResult; +class Path; class HTMLAreaElement : public HTMLAnchorElement { public: @@ -47,33 +47,34 @@ public: virtual IntRect getRect(RenderObject*) const; - String accessKey() const; - void setAccessKey(const String&); + const AtomicString& accessKey() const; + void setAccessKey(const AtomicString&); - String alt() const; - void setAlt(const String&); + const AtomicString& alt() const; + void setAlt(const AtomicString&); - String coords() const; - void setCoords(const String&); + const AtomicString& coords() const; + void setCoords(const AtomicString&); KURL href() const; - void setHref(const String&); + void setHref(const AtomicString&); bool noHref() const; void setNoHref(bool); - String shape() const; - void setShape(const String&); + const AtomicString& shape() const; + void setShape(const AtomicString&); virtual bool isFocusable() const; virtual String target() const; - void setTarget(const String&); + void setTarget(const AtomicString&); private: enum Shape { Default, Poly, Rect, Circle, Unknown }; Path getRegion(const IntSize&) const; - Path region; + + OwnPtr m_region; Length* m_coords; int m_coordsLen; IntSize m_lastSize; diff --git a/WebCore/html/HTMLCanvasElement.cpp b/WebCore/html/HTMLCanvasElement.cpp index 7481d96..1cd2796 100644 --- a/WebCore/html/HTMLCanvasElement.cpp +++ b/WebCore/html/HTMLCanvasElement.cpp @@ -280,7 +280,7 @@ TransformationMatrix HTMLCanvasElement::baseTransform() const IntSize size = convertLogicalToDevice(unscaledSize); TransformationMatrix transform; if (size.width() && size.height()) - transform.scale(size.width() / unscaledSize.width(), size.height() / unscaledSize.height()); + transform.scaleNonUniform(size.width() / unscaledSize.width(), size.height() / unscaledSize.height()); transform.multiply(m_imageBuffer->baseTransform()); return transform; } diff --git a/WebCore/html/HTMLCanvasElement.idl b/WebCore/html/HTMLCanvasElement.idl index e457c15..bf69ac0 100644 --- a/WebCore/html/HTMLCanvasElement.idl +++ b/WebCore/html/HTMLCanvasElement.idl @@ -38,7 +38,7 @@ module html { raises(DOMException); #if !defined(LANGUAGE_OBJECTIVE_C) - DOMObject getContext(in DOMString contextId); + [V8Custom] DOMObject getContext(in DOMString contextId); #endif }; diff --git a/WebCore/html/HTMLDocument.cpp b/WebCore/html/HTMLDocument.cpp index a987c76..01f151c 100644 --- a/WebCore/html/HTMLDocument.cpp +++ b/WebCore/html/HTMLDocument.cpp @@ -433,5 +433,11 @@ void HTMLDocument::clear() // We've long had a comment saying that IE doesn't support this. // But I do see it in the documentation for Mozilla. } - + +bool HTMLDocument::isFrameSet() const +{ + HTMLElement* bodyElement = body(); + return bodyElement && bodyElement->renderer() && bodyElement->hasTagName(framesetTag); +} + } diff --git a/WebCore/html/HTMLDocument.h b/WebCore/html/HTMLDocument.h index de84c70..ab5da50 100644 --- a/WebCore/html/HTMLDocument.h +++ b/WebCore/html/HTMLDocument.h @@ -88,6 +88,7 @@ protected: private: virtual bool isHTMLDocument() const { return true; } + virtual bool isFrameSet() const; virtual Tokenizer* createTokenizer(); virtual void determineParseMode(); diff --git a/WebCore/html/HTMLElement.cpp b/WebCore/html/HTMLElement.cpp index 4394bc8..906f847 100644 --- a/WebCore/html/HTMLElement.cpp +++ b/WebCore/html/HTMLElement.cpp @@ -96,23 +96,6 @@ int HTMLElement::tagPriority() const return 1; } -PassRefPtr HTMLElement::cloneNode(bool deep) -{ - RefPtr clone = HTMLElementFactory::createHTMLElement(tagQName(), document(), 0, false); - if (!clone) - return 0; - - if (namedAttrMap) - clone->attributes()->setAttributes(*namedAttrMap); - - clone->copyNonAttributeProperties(this); - - if (deep) - cloneChildNodes(clone.get()); - - return clone.release(); -} - bool HTMLElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const { if (attrName == alignAttr || @@ -947,8 +930,18 @@ bool HTMLElement::inEitherTagList(const Node* newChild) if (newChild->isHTMLElement()) { const HTMLElement* child = static_cast(newChild); - if (inlineTagList()->contains(child->tagQName().localName().impl())) + if (inlineTagList()->contains(child->tagQName().localName().impl())) { +#if PLATFORM(MAC) + if (child->tagQName().localName() == styleTag) { + // Leopard Mail doesn't expect