Commit 4cfcb8ae authored by aroben@apple.com's avatar aroben@apple.com

Make the implementation of Frame::setNeedsReapplyStyles cross-platform

 WebCore:

         Make the implementation of Frame::setNeedsReapplyStyles cross-platform

         Reviewed by Hyatt.

         No change in functionality.

         * page/Frame.cpp:
         (WebCore::Frame::setNeedsReapplyStyles): Added. Invalidates the
         FrameView so that FrameView::layout will be called, which ends up
         calling reapplyStyles.
         (WebCore::Frame::needsReapplyStyles): Added.
         (WebCore::Frame::reapplyStyles): Renamed from reparseConfiguration.
         (WebCore::FramePrivate::FramePrivate):
         * page/Frame.h:
         * page/FramePrivate.h: Added new boolean member.
         * page/FrameView.cpp:
         (WebCore::FrameView::layout): Call Frame::reapplyStyles if needed.
         (WebCore::FrameView::needsLayout): Say that we need layout if the
         Frame needs styles reapplied.
         * page/mac/WebCoreFrameBridge.h: Removed setNeedsReapplyStyles.
         * page/mac/WebCoreFrameBridge.mm:
         (-[WebCoreFrameBridge reapplyStylesForDeviceType:]): Updated for
         rename.

         * bridge/win/FrameWin.cpp: Removed Frame::setNeedsReapplyStyles.
         * page/gtk/FrameGtk.cpp: Ditto.
         * page/mac/FrameMac.mm: Ditto.
         * page/qt/FrameQt.cpp: Ditto.
         * platform/wx/TemporaryLinkStubs.cpp: Ditto.

 WebKit/mac:

         Remove -[WebFrameBridge setNeedsReapplyStyles]

         This functionality is now WebCore's responsibility.

         Reviewed by Hyatt.

         * WebCoreSupport/WebFrameBridge.mm:
         * WebKit.order:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28411 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1a16d0ff
2007-11-27 Adam Roben <aroben@apple.com>
Make the implementation of Frame::setNeedsReapplyStyles cross-platform
Reviewed by Hyatt.
No change in functionality.
* page/Frame.cpp:
(WebCore::Frame::setNeedsReapplyStyles): Added. Invalidates the
FrameView so that FrameView::layout will be called, which ends up
calling reapplyStyles.
(WebCore::Frame::needsReapplyStyles): Added.
(WebCore::Frame::reapplyStyles): Renamed from reparseConfiguration.
(WebCore::FramePrivate::FramePrivate):
* page/Frame.h:
* page/FramePrivate.h: Added new boolean member.
* page/FrameView.cpp:
(WebCore::FrameView::layout): Call Frame::reapplyStyles if needed.
(WebCore::FrameView::needsLayout): Say that we need layout if the
Frame needs styles reapplied.
* page/mac/WebCoreFrameBridge.h: Removed setNeedsReapplyStyles.
* page/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge reapplyStylesForDeviceType:]): Updated for
rename.
* bridge/win/FrameWin.cpp: Removed Frame::setNeedsReapplyStyles.
* page/gtk/FrameGtk.cpp: Ditto.
* page/mac/FrameMac.mm: Ditto.
* page/qt/FrameQt.cpp: Ditto.
* platform/wx/TemporaryLinkStubs.cpp: Ditto.
2007-12-04 Antti Koivisto <antti@apple.com>
Reviewed by Adele.
......
......@@ -194,10 +194,4 @@ void Frame::dashboardRegionsChanged()
{
}
void Frame::setNeedsReapplyStyles()
{
// Will be needed for focus ring color change.
notImplemented();
}
} // namespace WebCore
......@@ -758,8 +758,30 @@ String Frame::jsDefaultStatusBarText() const
return d->m_kjsDefaultStatusBarText;
}
void Frame::reparseConfiguration()
void Frame::setNeedsReapplyStyles()
{
if (d->m_needsReapplyStyles)
return;
d->m_needsReapplyStyles = true;
// Invalidate the FrameView so that FrameView::layout will get called,
// which calls reapplyStyles.
view()->invalidate();
}
bool Frame::needsReapplyStyles() const
{
return d->m_needsReapplyStyles;
}
void Frame::reapplyStyles()
{
d->m_needsReapplyStyles = false;
// FIXME: This call doesn't really make sense in a method called
// "reapplyStyles". We should probably eventually move it into its own
// method.
if (d->m_doc)
d->m_doc->docLoader()->setAutoLoadImages(d->m_page && d->m_page->settings()->loadsImagesAutomatically());
......@@ -1993,6 +2015,7 @@ FramePrivate::FramePrivate(Page* page, Frame* parent, Frame* thisFrame, HTMLFram
, m_inViewSourceMode(false)
, frameCount(0)
, m_prohibitsScrolling(false)
, m_needsReapplyStyles(false)
, m_windowScriptNPObject(0)
#if PLATFORM(MAC)
, m_windowScriptObject(nil)
......
......@@ -155,7 +155,6 @@ public:
static Frame* frameForWidget(const Widget*);
Settings* settings() const; // can be NULL
void reparseConfiguration();
void setUserStyleSheetLocation(const KURL&);
void setUserStyleSheet(const String& styleSheetData);
......@@ -197,6 +196,9 @@ public:
UChar backslashAsCurrencySymbol() const;
void setNeedsReapplyStyles();
bool needsReapplyStyles() const;
void reapplyStyles();
String documentTypeString() const;
void dashboardRegionsChanged();
......
......@@ -117,6 +117,8 @@ namespace WebCore {
bool m_prohibitsScrolling;
bool m_needsReapplyStyles;
// The root object used for objects bound outside the context of a plugin.
RefPtr<KJS::Bindings::RootObject> m_bindingRootObject;
RootObjectMap m_rootObjects;
......
......@@ -328,7 +328,6 @@ void FrameView::layout(bool allowSubtree)
d->layoutRoot = 0;
}
ASSERT(m_frame->view() == this);
Document* document = m_frame->document();
......@@ -349,7 +348,9 @@ void FrameView::layout(bool allowSubtree)
// Always ensure our style info is up-to-date. This can happen in situations where
// the layout beats any sort of style recalc update that needs to occur.
if (document->hasChangedChild())
if (m_frame->needsReapplyStyles())
m_frame->reapplyStyles();
else if (document->hasChangedChild())
document->recalcStyle();
bool subtree = d->layoutRoot;
......@@ -783,7 +784,7 @@ bool FrameView::needsLayout() const
RenderView* root = static_cast<RenderView*>(m_frame->renderer());
Document * doc = m_frame->document();
// doc->hasChangedChild() condition can occur when using WebKit ObjC interface
return layoutPending() || (root && root->needsLayout()) || d->layoutRoot || (doc && doc->hasChangedChild());
return layoutPending() || (root && root->needsLayout()) || d->layoutRoot || (doc && doc->hasChangedChild()) || m_frame->needsReapplyStyles();
}
void FrameView::setNeedsLayout()
......
......@@ -49,8 +49,4 @@ void Frame::dashboardRegionsChanged()
notImplemented();
}
void Frame::setNeedsReapplyStyles()
{
notImplemented();
}
}
......@@ -570,11 +570,6 @@ void Frame::willPopupMenu(NSMenu * menu)
[d->m_bridge willPopupMenu:menu];
}
void Frame::setNeedsReapplyStyles()
{
[d->m_bridge setNeedsReapplyStyles];
}
FloatRect Frame::customHighlightLineRect(const AtomicString& type, const FloatRect& lineRect, Node* node)
{
return [d->m_bridge customHighlightRect:type forLine:lineRect representedNode:node];
......
......@@ -246,8 +246,6 @@ enum WebScrollGranularity {
- (void)runOpenPanelForFileButtonWithResultListener:(id <WebCoreOpenPanelResultListener>)resultListener;
- (void)setNeedsReapplyStyles;
- (NSView *)viewForPluginWithFrame:(NSRect)frame
URL:(NSURL *)URL
attributeNames:(NSArray *)attributeNames
......
......@@ -394,7 +394,7 @@ static inline WebCoreFrameBridge *bridge(Frame *frame)
Document *doc = m_frame->document();
if (doc)
doc->setPrinting(deviceType == WebCoreDevicePrinter);
m_frame->reparseConfiguration();
m_frame->reapplyStyles();
}
- (void)forceLayoutAdjustingViewSize:(BOOL)flag
......
......@@ -117,10 +117,5 @@ void Frame::dashboardRegionsChanged()
{
}
void Frame::setNeedsReapplyStyles()
{
notImplemented();
}
}
// vim: ts=4 sw=4 et
......@@ -138,7 +138,6 @@ void GraphicsContext::setAlpha(float) { notImplemented(); }
Color WebCore::focusRingColor() { return 0xFF0000FF; }
void WebCore::setFocusRingColorChangeFunction(void (*)()) { }
void Frame::setNeedsReapplyStyles() { notImplemented(); }
void Image::drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, CompositeOperator, const FloatRect& destRect) { notImplemented(); }
PlatformScrollbar::PlatformScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize controlSize) : Scrollbar(client, orientation, controlSize) { notImplemented(); }
......
2007-11-27 Adam Roben <aroben@apple.com>
Remove -[WebFrameBridge setNeedsReapplyStyles]
This functionality is now WebCore's responsibility.
Reviewed by Hyatt.
* WebCoreSupport/WebFrameBridge.mm:
* WebKit.order:
2007-12-04 John Sullivan <sullivan@apple.com>
Reviewed by Darin
......
......@@ -349,16 +349,6 @@ NSString *WebPluginContainerKey = @"WebPluginContainer";
return newFrame.get();
}
- (void)setNeedsReapplyStyles
{
NSView <WebDocumentView> *view = [[_frame frameView] documentView];
if ([view isKindOfClass:[WebHTMLView class]]) {
[(WebHTMLView *)view setNeedsToApplyStyles:YES];
[view setNeedsLayout:YES];
[view setNeedsDisplay:YES];
}
}
- (NSView *)pluginViewWithPackage:(WebPluginPackage *)pluginPackage
attributeNames:(NSArray *)attributeNames
attributeValues:(NSArray *)attributeValues
......
......@@ -190,7 +190,6 @@ __ZNK20WebFrameLoaderClient17overrideMediaTypeEv
-[WebPreferences(WebPrivate) _useSiteSpecificSpoofing]
-[WebPreferences cursiveFontFamily]
-[WebPreferences _stringValueForKey:]
-[WebFrameBridge setNeedsReapplyStyles]
-[WebHTMLView setNeedsToApplyStyles:]
-[WebHTMLView setNeedsLayout:]
-[WebPreferences defaultFixedFontSize]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment