diff options
author | Steve Block <steveblock@google.com> | 2010-04-30 15:36:55 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-05-11 14:42:14 +0100 |
commit | fc38d325f67d0fc26fd82125299088a790627d31 (patch) | |
tree | 6d2b08740ba106d2460a90aeefcc67d671e63a95 /WebCore | |
parent | 8c053ec93ab9e7ff792eed9f0eb2fbc01155ad1d (diff) | |
download | external_webkit-fc38d325f67d0fc26fd82125299088a790627d31.zip external_webkit-fc38d325f67d0fc26fd82125299088a790627d31.tar.gz external_webkit-fc38d325f67d0fc26fd82125299088a790627d31.tar.bz2 |
Merge webkit.org at r58033 : Move Android iframe-flattening code to RenderIFrame.cpp
The Android iframe-flattening code was in RenderPartObject. The rendering
classes have been refactored upstream in http://trac.webkit.org/changeset/57866
so that most of RenderPartObject was moved to RenderIFrame. RenderPartObject was
then removed in http://trac.webkit.org/changeset/57900.
Iframe-flattening was also added upstream in
http://trac.webkit.org/changeset/56718.
This change takes the Android iframe-flattening code from RenderPartObject and
moves it to RenderIFrame. It also renames FLATTEN_IFRAME to
ANDROID_FLATTEN_IFRAME and FLATTEN_FRAMESET to ANDROID_FLATTEN_FRAMESET for
clarity.
Change-Id: I1af8d042f8d0c4abd513f8a315ac681360c1cc53
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/config.h | 4 | ||||
-rw-r--r-- | WebCore/html/HTMLFrameSetElement.cpp | 2 | ||||
-rw-r--r-- | WebCore/page/FrameView.cpp | 2 | ||||
-rw-r--r-- | WebCore/rendering/RenderFrame.cpp | 4 | ||||
-rw-r--r-- | WebCore/rendering/RenderFrame.h | 2 | ||||
-rw-r--r-- | WebCore/rendering/RenderFrameSet.cpp | 14 | ||||
-rw-r--r-- | WebCore/rendering/RenderFrameSet.h | 4 | ||||
-rw-r--r-- | WebCore/rendering/RenderIFrame.cpp | 134 | ||||
-rw-r--r-- | WebCore/rendering/RenderPartObject.cpp | 227 | ||||
-rw-r--r-- | WebCore/rendering/RenderPartObject.h | 60 | ||||
-rw-r--r-- | WebCore/rendering/RenderView.h | 2 | ||||
-rw-r--r-- | WebCore/rendering/RenderWidget.cpp | 2 |
12 files changed, 152 insertions, 305 deletions
diff --git a/WebCore/config.h b/WebCore/config.h index 1e2860f..24b0f14 100644 --- a/WebCore/config.h +++ b/WebCore/config.h @@ -126,8 +126,8 @@ #undef ENABLE_COMPOSITED_FIXED_ELEMENTS // Disabled by default in Platform.h #define ENABLE_COMPOSITED_FIXED_ELEMENTS 1 -#define FLATTEN_FRAMESET -#define FLATTEN_IFRAME +#define ANDROID_FLATTEN_FRAMESET +#define ANDROID_FLATTEN_IFRAME #define ANDROID_EXPOSE_COLUMN_GAP diff --git a/WebCore/html/HTMLFrameSetElement.cpp b/WebCore/html/HTMLFrameSetElement.cpp index 9cc4975..a669e59 100644 --- a/WebCore/html/HTMLFrameSetElement.cpp +++ b/WebCore/html/HTMLFrameSetElement.cpp @@ -215,7 +215,7 @@ void HTMLFrameSetElement::recalcStyle(StyleChange ch) { if (needsStyleRecalc() && renderer()) { renderer()->setNeedsLayout(true); -#ifdef FLATTEN_FRAMESET +#ifdef ANDROID_FLATTEN_FRAMESET static_cast<RenderFrameSet*>(renderer())->setGridNeedsLayout(); #endif setNeedsStyleRecalc(NoStyleChange); diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp index 1ebdf99..c69b514 100644 --- a/WebCore/page/FrameView.cpp +++ b/WebCore/page/FrameView.cpp @@ -1246,7 +1246,7 @@ void FrameView::scheduleRelayout() if (!m_frame->document()->shouldScheduleLayout()) return; -#if defined(FLATTEN_IFRAME) || defined(FLATTEN_FRAMESET) +#if defined(ANDROID_FLATTEN_IFRAME) || defined(ANDROID_FLATTEN_FRAMESET) // This is the Android frame flattening code. The common code below is not // used as frameSetFlatteningEnabled() is false on Android. if (m_frame->ownerRenderer()) diff --git a/WebCore/rendering/RenderFrame.cpp b/WebCore/rendering/RenderFrame.cpp index 46150ba..e7ad76a 100644 --- a/WebCore/rendering/RenderFrame.cpp +++ b/WebCore/rendering/RenderFrame.cpp @@ -28,7 +28,7 @@ #include "HTMLFrameElement.h" #include "RenderView.h" -#ifdef FLATTEN_FRAMESET +#ifdef ANDROID_FLATTEN_FRAMESET #include "Frame.h" #include "Document.h" #include "RenderView.h" @@ -65,7 +65,7 @@ void RenderFrame::viewCleared() view->setMarginHeight(marginh); } -#ifdef FLATTEN_FRAMESET +#ifdef ANDROID_FLATTEN_FRAMESET void RenderFrame::layout() { if (widget() && widget()->isFrameView()) { diff --git a/WebCore/rendering/RenderFrame.h b/WebCore/rendering/RenderFrame.h index 8f87b79..bdcaa4c 100644 --- a/WebCore/rendering/RenderFrame.h +++ b/WebCore/rendering/RenderFrame.h @@ -40,7 +40,7 @@ private: virtual const char* renderName() const { return "RenderFrame"; } virtual bool isFrame() const { return true; } -#ifdef FLATTEN_FRAMESET +#ifdef ANDROID_FLATTEN_FRAMESET virtual void layout(); #endif virtual void viewCleared(); diff --git a/WebCore/rendering/RenderFrameSet.cpp b/WebCore/rendering/RenderFrameSet.cpp index fca304c..35867f5 100644 --- a/WebCore/rendering/RenderFrameSet.cpp +++ b/WebCore/rendering/RenderFrameSet.cpp @@ -44,7 +44,7 @@ RenderFrameSet::RenderFrameSet(HTMLFrameSetElement* frameSet) : RenderBox(frameSet) , m_isResizing(false) , m_isChildResizing(false) -#ifdef FLATTEN_FRAMESET +#ifdef ANDROID_FLATTEN_FRAMESET , m_gridCalculated(false) #endif { @@ -461,7 +461,7 @@ void RenderFrameSet::layout() oldBounds = absoluteClippedOverflowRect(); if (!parent()->isFrameSet() && !document()->printing()) { -#ifdef FLATTEN_FRAMESET +#ifdef ANDROID_FLATTEN_FRAMESET // Force a grid recalc. m_gridCalculated = false; #endif @@ -475,12 +475,12 @@ void RenderFrameSet::layout() if (m_rows.m_sizes.size() != rows || m_cols.m_sizes.size() != cols) { m_rows.resize(rows); m_cols.resize(cols); -#ifdef FLATTEN_FRAMESET +#ifdef ANDROID_FLATTEN_FRAMESET m_gridCalculated = false; #endif } -#ifdef FLATTEN_FRAMESET +#ifdef ANDROID_FLATTEN_FRAMESET if (!m_gridCalculated) { m_gridCalculated = true; // Make all the child framesets recalculate their grid. @@ -493,7 +493,7 @@ void RenderFrameSet::layout() int borderThickness = frameSet()->border(); layOutAxis(m_rows, frameSet()->rowLengths(), height() - (rows - 1) * borderThickness); layOutAxis(m_cols, frameSet()->colLengths(), width() - (cols - 1) * borderThickness); -#ifdef FLATTEN_FRAMESET +#ifdef ANDROID_FLATTEN_FRAMESET } #endif @@ -527,7 +527,7 @@ void RenderFrameSet::positionFrames() int yPos = 0; int borderThickness = frameSet()->border(); -#ifdef FLATTEN_FRAMESET +#ifdef ANDROID_FLATTEN_FRAMESET // Keep track of the maximum width of a row which will become the maximum width of the frameset. int maxWidth = 0; const Length* rowLengths = frameSet()->rowLengths(); @@ -605,7 +605,7 @@ void RenderFrameSet::positionFrames() setWidth(max(width(), newWidth)); child = (RenderBox*)firstChild(); yPos = 0; -#endif // FLATTEN_FRAMESET +#endif // ANDROID_FLATTEN_FRAMESET for (int r = 0; r < rows; r++) { int xPos = 0; diff --git a/WebCore/rendering/RenderFrameSet.h b/WebCore/rendering/RenderFrameSet.h index 345648f..cdc7b5a 100644 --- a/WebCore/rendering/RenderFrameSet.h +++ b/WebCore/rendering/RenderFrameSet.h @@ -70,7 +70,7 @@ public: bool canResizeRow(const IntPoint&) const; bool canResizeColumn(const IntPoint&) const; -#ifdef FLATTEN_FRAMESET +#ifdef ANDROID_FLATTEN_FRAMESET void setGridNeedsLayout() { m_gridCalculated = false; } #endif @@ -128,7 +128,7 @@ private: bool m_isResizing; bool m_isChildResizing; -#ifdef FLATTEN_FRAMESET +#ifdef ANDROID_FLATTEN_FRAMESET bool m_gridCalculated; #endif }; diff --git a/WebCore/rendering/RenderIFrame.cpp b/WebCore/rendering/RenderIFrame.cpp index bfea7bd..5852468 100644 --- a/WebCore/rendering/RenderIFrame.cpp +++ b/WebCore/rendering/RenderIFrame.cpp @@ -43,6 +43,32 @@ RenderIFrame::RenderIFrame(Element* element) void RenderIFrame::calcHeight() { RenderPart::calcHeight(); +#ifdef ANDROID_FLATTEN_IFRAME + if (!node()->hasTagName(iframeTag) || !widget() || !widget()->isFrameView()) + return; + FrameView* view = static_cast<FrameView*>(widget()); + RenderView* root = static_cast<RenderView*>(view->frame()->contentRenderer()); + if (!root) + return; + // Do not expand if the scrollbars are suppressed and the height is fixed. + bool scrolling = static_cast<HTMLIFrameElement*>(node())->scrollingMode() != ScrollbarAlwaysOff; + if (!scrolling && style()->height().isFixed()) + return; + // Update the widget + updateWidgetPosition(); + + // Layout to get the content height + do { + view->layout(); + } while (view->layoutPending() || root->needsLayout()); + + int extraHeight = paddingTop() + paddingBottom() + borderTop() + borderBottom(); + setHeight(max(width(), view->contentsHeight() + extraHeight)); + + // Update one last time to ensure the dimensions. + updateWidgetPosition(); + return; +#endif if (!flattenFrame()) return; @@ -59,6 +85,39 @@ void RenderIFrame::calcHeight() void RenderIFrame::calcWidth() { RenderPart::calcWidth(); +#ifdef ANDROID_FLATTEN_IFRAME + if (!node()->hasTagName(iframeTag) || !widget() || !widget()->isFrameView()) + return; + FrameView* view = static_cast<FrameView*>(widget()); + RenderView* root = static_cast<RenderView*>(view->frame()->contentRenderer()); + if (!root) + return; + // Do not expand if the scrollbars are suppressed and the width is fixed. + bool scrolling = static_cast<HTMLIFrameElement*>(node())->scrollingMode() != ScrollbarAlwaysOff; + if (!scrolling && style()->width().isFixed()) + return; + // Update the dimensions to get the correct minimum preferred + // width + updateWidgetPosition(); + + int extraWidth = paddingLeft() + paddingRight() + borderLeft() + borderRight(); + // Set the width + setWidth(max(width(), root->minPrefWidth()) + extraWidth); + + // Update based on the new width + updateWidgetPosition(); + + // Layout to get the content width + do { + view->layout(); + } while (view->layoutPending() || root->needsLayout()); + + setWidth(max(width(), view->contentsWidth() + extraWidth)); + + // Update one last time to ensure the dimensions. + updateWidgetPosition(); + return; +#endif if (!flattenFrame()) return; @@ -105,6 +164,81 @@ void RenderIFrame::layout() RenderPart::calcWidth(); RenderPart::calcHeight(); +#ifdef ANDROID_FLATTEN_IFRAME + // Calculate the styled dimensions by subtracting the border and padding. + int extraWidth = paddingLeft() + paddingRight() + borderLeft() + borderRight(); + int extraHeight = paddingTop() + paddingBottom() + borderTop() + borderBottom(); + int styleWidth = width() - extraWidth; + int styleHeight = height() - extraHeight; + // Some IFrames have a width and/or height of 1 when they are meant to be + // hidden. If that is the case, do not try to expand. + if (node()->hasTagName(iframeTag) && widget() && widget()->isFrameView() && + styleWidth > 1 && styleHeight > 1) { + HTMLIFrameElement* element = static_cast<HTMLIFrameElement*>(node()); + bool scrolling = element->scrollingMode() != ScrollbarAlwaysOff; + bool widthIsFixed = style()->width().isFixed(); + bool heightIsFixed = style()->height().isFixed(); + // If an iframe has a fixed dimension and suppresses scrollbars, it + // will disrupt layout if we force it to expand. Plus on a desktop, + // the extra content is not accessible. + if (scrolling || !widthIsFixed || !heightIsFixed) { + FrameView* view = static_cast<FrameView*>(widget()); + RenderView* root = view ? view->frame()->contentRenderer() : NULL; + if (root && style()->visibility() != HIDDEN) { + // Update the dimensions to get the correct minimum preferred + // width + updateWidgetPosition(); + + // Use the preferred width if it is larger and only if + // scrollbars are visible or the width style is not fixed. + if (scrolling || !widthIsFixed) + setWidth(max(width(), root->minPrefWidth()) + extraWidth); + + // Resize the view to recalc the height. + int h = height() - extraHeight; + int w = width() - extraWidth; + if (w > view->width()) + h = 0; + if (w != view->width() || h != view->height()) { + view->resize(w, h); + } + + // Layout the view. + do { + view->layout(); + } while (view->layoutPending() || root->needsLayout()); + + int contentHeight = view->contentsHeight(); + int contentWidth = view->contentsWidth(); + // Only change the width or height if scrollbars are visible or + // if the style is not a fixed value. Use the maximum value so + // that iframes never shrink. + if (scrolling || !heightIsFixed) + setHeight(max(height(), contentHeight + extraHeight)); + if (scrolling || !widthIsFixed) + setWidth(max(width(), contentWidth + extraWidth)); + + // Update one last time + updateWidgetPosition(); + + // Layout one more time to ensure all objects have the correct + // height. + view->layout(); + +#if !ASSERT_DISABLED + ASSERT(!view->layoutPending()); + ASSERT(!root->needsLayout()); + // Sanity check when assertions are enabled. + RenderObject* c = root->nextInPreOrder(); + while (c) { + ASSERT(!c->needsLayout()); + c = c->nextInPreOrder(); + } +#endif + } + } + } +#endif if (flattenFrame()) { layoutWithFlattening(style()->width().isFixed(), style()->height().isFixed()); return; diff --git a/WebCore/rendering/RenderPartObject.cpp b/WebCore/rendering/RenderPartObject.cpp deleted file mode 100644 index 617c8bf..0000000 --- a/WebCore/rendering/RenderPartObject.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 2000 Simon Hausmann <hausmann@kde.org> - * (C) 2000 Stefan Schimanski (1Stein@gmx.de) - * Copyright (C) 2004, 2005, 2006, 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 - * 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 "RenderPartObject.h" - -#include "Frame.h" -#include "FrameLoaderClient.h" -#include "HTMLEmbedElement.h" -#include "HTMLIFrameElement.h" -#include "HTMLNames.h" -#include "HTMLObjectElement.h" -#include "HTMLParamElement.h" -#include "MIMETypeRegistry.h" -#include "Page.h" -#include "RenderView.h" -#include "RenderWidgetProtector.h" -#include "Text.h" - -#if ENABLE(PLUGIN_PROXY_FOR_VIDEO) -#include "HTMLVideoElement.h" -#endif - -namespace WebCore { - -using namespace HTMLNames; - -RenderPartObject::RenderPartObject(Element* element) - : RenderPart(element) -{ -} - -void RenderPartObject::layout() -{ - ASSERT(needsLayout()); - -#ifdef FLATTEN_IFRAME - RenderPart::calcWidth(); - RenderPart::calcHeight(); - // Calculate the styled dimensions by subtracting the border and padding. - int extraWidth = paddingLeft() + paddingRight() + borderLeft() + borderRight(); - int extraHeight = paddingTop() + paddingBottom() + borderTop() + borderBottom(); - int styleWidth = width() - extraWidth; - int styleHeight = height() - extraHeight; - // Some IFrames have a width and/or height of 1 when they are meant to be - // hidden. If that is the case, do not try to expand. - if (node()->hasTagName(iframeTag) && widget() && widget()->isFrameView() && - styleWidth > 1 && styleHeight > 1) { - HTMLIFrameElement* element = static_cast<HTMLIFrameElement*>(node()); - bool scrolling = element->scrollingMode() != ScrollbarAlwaysOff; - bool widthIsFixed = style()->width().isFixed(); - bool heightIsFixed = style()->height().isFixed(); - // If an iframe has a fixed dimension and suppresses scrollbars, it - // will disrupt layout if we force it to expand. Plus on a desktop, - // the extra content is not accessible. - if (scrolling || !widthIsFixed || !heightIsFixed) { - FrameView* view = static_cast<FrameView*>(widget()); - RenderView* root = view ? view->frame()->contentRenderer() : NULL; - if (root && style()->visibility() != HIDDEN) { - // Update the dimensions to get the correct minimum preferred - // width - updateWidgetPosition(); - - // Use the preferred width if it is larger and only if - // scrollbars are visible or the width style is not fixed. - if (scrolling || !widthIsFixed) - setWidth(max(width(), root->minPrefWidth()) + extraWidth); - - // Resize the view to recalc the height. - int h = height() - extraHeight; - int w = width() - extraWidth; - if (w > view->width()) - h = 0; - if (w != view->width() || h != view->height()) { - view->resize(w, h); - } - - // Layout the view. - do { - view->layout(); - } while (view->layoutPending() || root->needsLayout()); - - int contentHeight = view->contentsHeight(); - int contentWidth = view->contentsWidth(); - // Only change the width or height if scrollbars are visible or - // if the style is not a fixed value. Use the maximum value so - // that iframes never shrink. - if (scrolling || !heightIsFixed) - setHeight(max(height(), contentHeight + extraHeight)); - if (scrolling || !widthIsFixed) - setWidth(max(width(), contentWidth + extraWidth)); - - // Update one last time - updateWidgetPosition(); - - // Layout one more time to ensure all objects have the correct - // height. - view->layout(); - -#if !ASSERT_DISABLED - ASSERT(!view->layoutPending()); - ASSERT(!root->needsLayout()); - // Sanity check when assertions are enabled. - RenderObject* c = root->nextInPreOrder(); - while (c) { - ASSERT(!c->needsLayout()); - c = c->nextInPreOrder(); - } -#endif - } - } - } -#else - calcWidth(); - calcHeight(); -#endif - - RenderPart::layout(); - - m_overflow.clear(); - addShadowOverflow(); - - setNeedsLayout(false); -} - -#ifdef FLATTEN_IFRAME -void RenderPartObject::calcWidth() { - RenderPart::calcWidth(); - if (!node()->hasTagName(iframeTag) || !widget() || !widget()->isFrameView()) - return; - FrameView* view = static_cast<FrameView*>(widget()); - RenderView* root = static_cast<RenderView*>(view->frame()->contentRenderer()); - if (!root) - return; - // Do not expand if the scrollbars are suppressed and the width is fixed. - bool scrolling = static_cast<HTMLIFrameElement*>(node())->scrollingMode() != ScrollbarAlwaysOff; - if (!scrolling && style()->width().isFixed()) - return; - // Update the dimensions to get the correct minimum preferred - // width - updateWidgetPosition(); - - int extraWidth = paddingLeft() + paddingRight() + borderLeft() + borderRight(); - // Set the width - setWidth(max(width(), root->minPrefWidth()) + extraWidth); - - // Update based on the new width - updateWidgetPosition(); - - // Layout to get the content width - do { - view->layout(); - } while (view->layoutPending() || root->needsLayout()); - - setWidth(max(width(), view->contentsWidth() + extraWidth)); - - // Update one last time to ensure the dimensions. - updateWidgetPosition(); -} - -void RenderPartObject::calcHeight() { - RenderPart::calcHeight(); - if (!node()->hasTagName(iframeTag) || !widget() || !widget()->isFrameView()) - return; - FrameView* view = static_cast<FrameView*>(widget()); - RenderView* root = static_cast<RenderView*>(view->frame()->contentRenderer()); - if (!root) - return; - // Do not expand if the scrollbars are suppressed and the height is fixed. - bool scrolling = static_cast<HTMLIFrameElement*>(node())->scrollingMode() != ScrollbarAlwaysOff; - if (!scrolling && style()->height().isFixed()) - return; - // Update the widget - updateWidgetPosition(); - - // Layout to get the content height - do { - view->layout(); - } while (view->layoutPending() || root->needsLayout()); - - int extraHeight = paddingTop() + paddingBottom() + borderTop() + borderBottom(); - setHeight(max(width(), view->contentsHeight() + extraHeight)); - - // Update one last time to ensure the dimensions. - updateWidgetPosition(); -} -#endif - -void RenderPartObject::viewCleared() -{ - if (node() && widget() && widget()->isFrameView()) { - FrameView* view = static_cast<FrameView*>(widget()); - int marginw = -1; - int marginh = -1; - if (node()->hasTagName(iframeTag)) { - HTMLIFrameElement* frame = static_cast<HTMLIFrameElement*>(node()); - marginw = frame->getMarginWidth(); - marginh = frame->getMarginHeight(); - } - if (marginw != -1) - view->setMarginWidth(marginw); - if (marginh != -1) - view->setMarginHeight(marginh); - } -} - -} diff --git a/WebCore/rendering/RenderPartObject.h b/WebCore/rendering/RenderPartObject.h deleted file mode 100644 index 1175a31..0000000 --- a/WebCore/rendering/RenderPartObject.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 2000 Simon Hausmann <hausmann@kde.org> - * Copyright (C) 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 - * 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 RenderPartObject_h -#define RenderPartObject_h - -#include "RenderPart.h" - -namespace WebCore { - -// Renderer for iframes. Is subclassed in RenderEmbeddedObject for object and embed. -class RenderPartObject : public RenderPart { -public: - RenderPartObject(Element*); - -#ifdef FLATTEN_IFRAME -protected: - virtual void calcWidth(); - virtual void calcHeight(); -#endif - -private: - virtual const char* renderName() const { return "RenderPartObject"; } - - virtual void layout(); - - virtual void viewCleared(); -}; - -inline RenderPartObject* toRenderPartObject(RenderObject* object) -{ - ASSERT(!object || !strcmp(object->renderName(), "RenderPartObject")); - return static_cast<RenderPartObject*>(object); -} - -// This will catch anyone doing an unnecessary cast. -void toRenderPartObject(const RenderPartObject*); - -} // namespace WebCore - -#endif // RenderPartObject_h diff --git a/WebCore/rendering/RenderView.h b/WebCore/rendering/RenderView.h index fb68da3..0751866 100644 --- a/WebCore/rendering/RenderView.h +++ b/WebCore/rendering/RenderView.h @@ -176,7 +176,7 @@ protected: private: bool shouldRepaint(const IntRect& r) const; -#ifdef FLATTEN_FRAMESET +#ifdef ANDROID_FLATTEN_FRAMESET public: // used by layout function #endif int docHeight() const; diff --git a/WebCore/rendering/RenderWidget.cpp b/WebCore/rendering/RenderWidget.cpp index b03dcd6..485baa3 100644 --- a/WebCore/rendering/RenderWidget.cpp +++ b/WebCore/rendering/RenderWidget.cpp @@ -325,7 +325,7 @@ void RenderWidget::updateWidgetPosition() bool boundsChanged = setWidgetGeometry(IntRect(absPos.x(), absPos.y(), w, h)); -#ifndef FLATTEN_IFRAME +#ifndef ANDROID_FLATTEN_IFRAME // if the frame bounds got changed, or if view needs layout (possibly indicating // content size is wrong) we have to do a layout to set the right widget size if (m_widget->isFrameView()) { |