Commit d53573ca authored by bdakin@apple.com's avatar bdakin@apple.com

Fix for https://bugs.webkit.org/show_bug.cgi?id=52309 Expose

fixed layout through WebKit SPI
-and corresponding-
<rdar://problem/8844464>

Reviewed by Anders Carlsson.

Source/WebCore: 

Export symbols for ScrollView::setUseFixedLayout() and 
ScrollView::setFixedLayoutSize()
* WebCore.exp.in:

WebKit/mac: 

* WebView/WebView.mm:
(-[WebView _setUseFixedLayout:]):
(-[WebView _setFixedLayoutSize:]):
* WebView/WebViewPrivate.h:

WebKit2: 

Store useFixedLayout and fixedLayoutSize in the 
WebPageCreationParameters and the WebPageProxy.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/API/C/WKPage.cpp:
(WKPageSetUseFixedLayout):
(WKPageSetFixedLayoutSize):
* UIProcess/API/C/WKPage.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::setUseFixedLayout):
(WebKit::WebPageProxy::setFixedLayoutSize):
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setUseFixedLayout):
(WebKit::WebPage::setFixedLayoutSize):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75635 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 18e618b3
2011-01-12 Beth Dakin <bdakin@apple.com>
Reviewed by Anders Carlsson.
Fix for https://bugs.webkit.org/show_bug.cgi?id=52309 Expose
fixed layout through WebKit SPI
-and corresponding-
<rdar://problem/8844464>
Export symbols for ScrollView::setUseFixedLayout() and
ScrollView::setFixedLayoutSize()
* WebCore.exp.in:
2011-01-12 Robert Hogan <robert@webkit.org>
Reviewed by Kenneth Rohde Christiansen.
......
......@@ -141,6 +141,8 @@ __ZN7WebCore10CredentialC1ERKN3WTF6StringES4_NS_21CredentialPersistenceE
__ZN7WebCore10CredentialC1Ev
__ZN7WebCore10JSDocument6s_infoE
__ZN7WebCore10MouseEventC1ERKN3WTF12AtomicStringEbbNS1_10PassRefPtrINS_9DOMWindowEEEiiiiibbbbtNS5_INS_11EventTargetEEENS5_INS_9ClipboardEEEb
__ZN7WebCore10ScrollView17setUseFixedLayoutEb
__ZN7WebCore10ScrollView18setFixedLayoutSizeERKNS_7IntSizeE
__ZN7WebCore10ScrollView20setCanHaveScrollbarsEb
__ZN7WebCore10ScrollView24windowResizerRectChangedEv
__ZN7WebCore10deleteFileERKN3WTF6StringE
......
2011-01-12 Beth Dakin <bdakin@apple.com>
Reviewed by Anders Carlsson.
Fix for https://bugs.webkit.org/show_bug.cgi?id=52309 Expose
fixed layout through WebKit SPI
-and corresponding-
<rdar://problem/8844464>
* WebView/WebView.mm:
(-[WebView _setUseFixedLayout:]):
(-[WebView _setFixedLayoutSize:]):
* WebView/WebViewPrivate.h:
2011-01-07 Enrica Casucci <enrica@apple.com>
Reviewed by Alexey Proskuryakov.
......
......@@ -2653,6 +2653,35 @@ static PassOwnPtr<Vector<String> > toStringVector(NSArray* patterns)
return coreFrame->pageScaleFactor();
}
- (void)_setUseFixedLayout:(BOOL)fixed
{
Frame* coreFrame = [self _mainCoreFrame];
if (!coreFrame)
return;
FrameView* view = coreFrame->view();
if (!view)
return;
view->setUseFixedLayout(fixed);
if (!fixed)
view->setFixedLayoutSize(IntSize());
}
- (void)_setFixedLayoutSize:(NSSize)size
{
Frame* coreFrame = [self _mainCoreFrame];
if (!coreFrame)
return;
FrameView* view = coreFrame->view();
if (!view)
return;
view->setFixedLayoutSize(IntSize(size));
view->forceLayout();
}
- (NSUInteger)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag highlight:(BOOL)highlight limit:(NSUInteger)limit
{
return [self countMatchesForText:string options:(caseFlag ? 0 : WebFindOptionsCaseInsensitive) highlight:highlight limit:limit markMatches:YES];
......
......@@ -547,6 +547,9 @@ Could be worth adding to the API.
- (void)_scaleWebView:(float)scale atOrigin:(NSPoint)origin;
- (float)_viewScaleFactor;
- (void)_setUseFixedLayout:(BOOL)fixed;
- (void)_setFixedLayoutSize:(NSSize)size;
// Deprecated. Use the methods in pending public above instead.
- (WebNSUInteger)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag highlight:(BOOL)highlight limit:(WebNSUInteger)limit;
- (WebNSUInteger)countMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag highlight:(BOOL)highlight limit:(WebNSUInteger)limit markMatches:(BOOL)markMatches;
......
2011-01-12 Beth Dakin <bdakin@apple.com>
Reviewed by Anders Carlsson.
Fix for https://bugs.webkit.org/show_bug.cgi?id=52309 Expose
fixed layout through WebKit SPI
-and corresponding-
<rdar://problem/8844464>
Store useFixedLayout and fixedLayoutSize in the
WebPageCreationParameters and the WebPageProxy.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/API/C/WKPage.cpp:
(WKPageSetUseFixedLayout):
(WKPageSetFixedLayoutSize):
* UIProcess/API/C/WKPage.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::setUseFixedLayout):
(WebKit::WebPageProxy::setFixedLayoutSize):
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setUseFixedLayout):
(WebKit::WebPage::setFixedLayoutSize):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2011-01-12 Anders Carlsson <andersca@apple.com>
Reviewed by Beth Dakin.
......@@ -42,6 +42,8 @@ void WebPageCreationParameters::encode(CoreIPC::ArgumentEncoder* encoder) const
encoder->encode(pageGroupData);
encoder->encode(drawsBackground);
encoder->encode(drawsTransparentBackground);
encoder->encode(useFixedLayout);
encoder->encode(fixedLayoutSize);
encoder->encode(userAgent);
encoder->encode(sessionState);
encoder->encode(highestUsedBackForwardItemID);
......@@ -77,6 +79,10 @@ bool WebPageCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, WebPag
return false;
if (!decoder->decode(parameters.drawsTransparentBackground))
return false;
if (!decoder->decode(parameters.useFixedLayout))
return false;
if (!decoder->decode(parameters.fixedLayoutSize))
return false;
if (!decoder->decode(parameters.userAgent))
return false;
if (!decoder->decode(parameters.sessionState))
......
......@@ -58,6 +58,9 @@ struct WebPageCreationParameters {
bool drawsBackground;
bool drawsTransparentBackground;
bool useFixedLayout;
WebCore::IntSize fixedLayoutSize;
String userAgent;
SessionState sessionState;
......
......@@ -265,6 +265,16 @@ void WKPageScaleWebView(WKPageRef pageRef, double scale, WKPoint origin)
toImpl(pageRef)->scaleWebView(scale, toIntPoint(origin));
}
void WKPageSetUseFixedLayout(WKPageRef pageRef, bool fixed)
{
toImpl(pageRef)->setUseFixedLayout(fixed);
}
void WKPageSetFixedLayoutSize(WKPageRef pageRef, WKSize size)
{
toImpl(pageRef)->setFixedLayoutSize(toIntSize(size));
}
double WKPageGetViewScaleFactor(WKPageRef pageRef)
{
return toImpl(pageRef)->viewScaleFactor();
......
......@@ -307,6 +307,9 @@ WK_EXPORT void WKPageSetPageAndTextZoomFactors(WKPageRef page, double pageZoomFa
WK_EXPORT void WKPageScaleWebView(WKPageRef page, double scale, WKPoint origin);
WK_EXPORT double WKPageGetViewScaleFactor(WKPageRef page);
WK_EXPORT void WKPageSetUseFixedLayout(WKPageRef page, bool fixed);
WK_EXPORT void WKPageSetFixedLayoutSize(WKPageRef page, WKSize size);
WK_EXPORT void WKPageFindString(WKPageRef page, WKStringRef string, WKFindOptions findOptions, unsigned maxMatchCount);
WK_EXPORT void WKPageHideFindUI(WKPageRef page);
WK_EXPORT void WKPageCountStringMatches(WKPageRef page, WKStringRef string, WKFindOptions findOptions, unsigned maxMatchCount);
......
......@@ -107,6 +107,7 @@ WebPageProxy::WebPageProxy(PageClient* pageClient, WebContext* context, WebPageG
, m_viewScaleFactor(1)
, m_drawsBackground(true)
, m_drawsTransparentBackground(false)
, m_useFixedLayout(false)
, m_isValid(true)
, m_isClosed(false)
, m_inDecidePolicyForMIMEType(false)
......@@ -844,6 +845,32 @@ void WebPageProxy::scaleWebView(double scale, const IntPoint& origin)
process()->send(Messages::WebPage::ScaleWebView(scale, origin), m_pageID);
}
void WebPageProxy::setUseFixedLayout(bool fixed)
{
if (!isValid())
return;
if (fixed == m_useFixedLayout)
return;
m_useFixedLayout = fixed;
if (!fixed)
m_fixedLayoutSize = IntSize();
process()->send(Messages::WebPage::SetUseFixedLayout(fixed), m_pageID);
}
void WebPageProxy::setFixedLayoutSize(const IntSize& size)
{
if (!isValid())
return;
if (size == m_fixedLayoutSize)
return;
m_fixedLayoutSize = size;
process()->send(Messages::WebPage::SetFixedLayoutSize(size), m_pageID);
}
void WebPageProxy::findString(const String& string, FindOptions options, unsigned maxMatchCount)
{
process()->send(Messages::WebPage::FindString(string, options, maxMatchCount), m_pageID);
......@@ -2182,6 +2209,8 @@ WebPageCreationParameters WebPageProxy::creationParameters() const
parameters.pageGroupData = m_pageGroup->data();
parameters.drawsBackground = m_drawsBackground;
parameters.drawsTransparentBackground = m_drawsTransparentBackground;
parameters.useFixedLayout = m_useFixedLayout;
parameters.fixedLayoutSize = m_fixedLayoutSize;
parameters.userAgent = userAgent();
parameters.sessionState = SessionState(m_backForwardList->entries(), m_backForwardList->currentIndex());
parameters.highestUsedBackForwardItemID = WebBackForwardListItem::highedUsedItemID();
......
......@@ -240,6 +240,9 @@ public:
void scaleWebView(double scale, const WebCore::IntPoint& origin);
double viewScaleFactor() const { return m_viewScaleFactor; }
void setUseFixedLayout(bool);
void setFixedLayoutSize(const WebCore::IntSize&);
#if PLATFORM(MAC)
void sendAccessibilityPresenterToken(const CoreIPC::DataReference&);
#endif
......@@ -552,6 +555,9 @@ private:
bool m_drawsBackground;
bool m_drawsTransparentBackground;
bool m_useFixedLayout;
WebCore::IntSize m_fixedLayoutSize;
// If the process backing the web page is alive and kicking.
bool m_isValid;
......
......@@ -597,6 +597,35 @@ double WebPage::viewScaleFactor() const
return frame->pageScaleFactor();
}
void WebPage::setUseFixedLayout(bool fixed)
{
Frame* frame = m_mainFrame->coreFrame();
if (!frame)
return;
FrameView* view = frame->view();
if (!view)
return;
view->setUseFixedLayout(fixed);
if (!fixed)
view->setFixedLayoutSize(IntSize());
}
void WebPage::setFixedLayoutSize(const IntSize& size)
{
Frame* frame = m_mainFrame->coreFrame();
if (!frame)
return;
FrameView* view = frame->view();
if (!view)
return;
view->setFixedLayoutSize(size);
view->forceLayout();
}
void WebPage::installPageOverlay(PassRefPtr<PageOverlay> pageOverlay)
{
if (m_pageOverlay)
......
......@@ -192,6 +192,9 @@ public:
void scaleWebView(double scale, const WebCore::IntPoint& origin);
double viewScaleFactor() const;
void setUseFixedLayout(bool);
void setFixedLayoutSize(const WebCore::IntSize&);
bool drawsBackground() const { return m_drawsBackground; }
bool drawsTransparentBackground() const { return m_drawsTransparentBackground; }
......
......@@ -88,6 +88,9 @@ messages -> WebPage {
ScaleWebView(double scale, WebCore::IntPoint origin)
SetUseFixedLayout(bool fixed)
SetFixedLayoutSize(WebCore::IntSize size)
# Find.
FindString(WTF::String string, uint32_t findOptions, unsigned maxMatchCount)
HideFindUI()
......
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