cache parsed interfaces in CodeGenerator.pm
https://bugs.webkit.org/show_bug.cgi?id=113446

Patch by Arnaud Renevier <a.renevier@sisa.samsung.com> on 2013-03-27
Reviewed by Kentaro Hara.

When generating binding for an interface, informations about parent
interfaces are sometimes needed several times. This patch caches
those the parsed interface. When generating all WebCore bindings, this
results in a speedup of about 40% for JavaScriptCore and about 80% for
V8.

No new tests: no change in behaviour.

* bindings/scripts/CodeGenerator.pm:
(ParseInterface):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147037 268f45cc-cd09-0410-ab3c-d52691b4dbfc
javascriptcore bindings do not check exception after calling valueToStringWithNullCheck
https://bugs.webkit.org/show_bug.cgi?id=113219

Patch by Arnaud Renevier <a.renevier@sisa.samsung.com> on 2013-03-27
Reviewed by Kentaro Hara.

Source/WebCore:

When converting JSValue to native value in attribute setter, store the
native value in a temporary variable. After this variable assignment,
always check if an exception has been raised.

Update binding tests.

Test: fast/dom/exception-in-binding.html

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GetNativeType):
(JSValueToNative):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
(WebCore::setJSTestInterfaceSupplementalStr2):
(WebCore::setJSTestInterfaceSupplementalNode):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::setJSTestObjConstructorStaticStringAttr):
(WebCore::setJSTestObjEnumAttr):
(WebCore::setJSTestObjShortAttr):
(WebCore::setJSTestObjUnsignedShortAttr):
(WebCore::setJSTestObjLongAttr):
(WebCore::setJSTestObjLongLongAttr):
(WebCore::setJSTestObjUnsignedLongLongAttr):
(WebCore::setJSTestObjStringAttr):
(WebCore::setJSTestObjTestObjAttr):
(WebCore::setJSTestObjXMLObjAttr):
(WebCore::setJSTestObjCreate):
(WebCore::setJSTestObjReflectedStringAttr):
(WebCore::setJSTestObjReflectedIntegralAttr):
(WebCore::setJSTestObjReflectedUnsignedIntegralAttr):
(WebCore::setJSTestObjReflectedBooleanAttr):
(WebCore::setJSTestObjReflectedURLAttr):
(WebCore::setJSTestObjReflectedCustomIntegralAttr):
(WebCore::setJSTestObjReflectedCustomBooleanAttr):
(WebCore::setJSTestObjReflectedCustomURLAttr):
(WebCore::setJSTestObjTypedArrayAttr):
(WebCore::setJSTestObjAttrWithGetterException):
(WebCore::setJSTestObjAttrWithSetterException):
(WebCore::setJSTestObjStringAttrWithGetterException):
(WebCore::setJSTestObjStringAttrWithSetterException):
(WebCore::setJSTestObjWithScriptStateAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAttribute):
(WebCore::setJSTestObjWithScriptStateAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
(WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
(WebCore::setJSTestObjConditionalAttr1):
(WebCore::setJSTestObjConditionalAttr2):
(WebCore::setJSTestObjConditionalAttr3):
(WebCore::setJSTestObjAnyAttribute):
(WebCore::setJSTestObjMutablePoint):
(WebCore::setJSTestObjImmutablePoint):
(WebCore::setJSTestObjStrawberry):
(WebCore::setJSTestObjStrictFloat):
(WebCore::setJSTestObjId):
(WebCore::setJSTestObjNullableLongSettableAttribute):
(WebCore::setJSTestObjNullableStringValue):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::setJSTestSerializedScriptValueInterfaceValue):
(WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::setJSTestTypedefsUnsignedLongLongAttr):
(WebCore::setJSTestTypedefsImmutableSerializedScriptValue):
(WebCore::setJSTestTypedefsAttrWithGetterException):
(WebCore::setJSTestTypedefsAttrWithSetterException):
(WebCore::setJSTestTypedefsStringAttrWithGetterException):
(WebCore::setJSTestTypedefsStringAttrWithSetterException):

LayoutTests:

* fast/dom/exception-in-binding-expected.txt: Added.
* fast/dom/exception-in-binding.html: Added.
* platform/chromium/TestExpectations: new test fails for now

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Need WK2 API to give a WebView a header and footer
https://bugs.webkit.org/show_bug.cgi?id=113352
-and corresponding-
<rdar://problem/13383835>

Reviewed by Simon Fraser.

Source/WebCore: 

This API will require RenderLayerCompositor to keep layers for the header and 
footer when the exist. It also requires the scrolling machinery to know that the 
size of the scrollable area will differ from the contentsSize when there is a 
header or footer.

setWantsLayerForHeader() and setWantsLayerForFooter() return GraphicsLayers to 
WK2. setHeaderHeight() and setFooterHeight() set the header and footer heights
respectively.
* WebCore.exp.in:
* page/FrameView.h:
(FrameView):
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::setWantsLayerForHeader):
(WebCore::FrameView::setWantsLayerForFooter):
(WebCore::FrameView::setHeaderHeight):
(WebCore::FrameView::setFooterHeight):

Should use totalContentsSize() instead of contentsSize().
(WebCore::FrameView::windowClipRect):
(WebCore::FrameView::isScrollable):
* page/SpatialNavigation.cpp:
(WebCore::canScrollInDirection):

This should also use totalContentsSize() instead of contentsSize(), and while 
we're at it, re-name the variable and function names in the scrolling tree code 
from contentsSize to totalContentsSize.
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setTotalContentsSize):
(WebCore::ScrollingStateScrollingNode::dumpProperties):
* page/scrolling/ScrollingStateScrollingNode.h:
(WebCore::ScrollingStateScrollingNode::totalContentsSize):
(ScrollingStateScrollingNode):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::totalContentsSize):
(ScrollingTreeScrollingNode):
* page/scrolling/mac/ScrollingCoordinatorMac.h:
(ScrollParameters):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::frameViewLayoutUpdated):
(WebCore::ScrollingCoordinatorMac::setScrollParametersForNode):
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::updateAfterChildren):
(WebCore::ScrollingTreeScrollingNodeMac::setScrollLayerPosition):
(WebCore::ScrollingTreeScrollingNodeMac::maximumScrollPosition):

Use totalContentsSize() instead of contentsSize().
* platform/ScrollView.cpp:
(WebCore::ScrollView::maximumScrollPosition):
(WebCore::ScrollView::setScrollOffset):
(WebCore::ScrollView::overhangAmount):
(WebCore::ScrollView::updateScrollbars):
(WebCore::ScrollView::calculateOverhangAreasForPainting):

scrollOffset() represents the offset within the totalContentsSize, but that is 
not what we need here. So subtract out the headerHeight() for the appropriate 
value.
(WebCore::ScrollView::windowToContents):
(WebCore::ScrollView::contentsToWindow):

Use totalContentsSize() instead of contentsSize().
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::maximumScrollPosition):
(WebCore):
(WebCore::ScrollableArea::totalContentsSize):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::headerHeight):
(WebCore::ScrollableArea::footerHeight):
(ScrollableArea):
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::adjustScrollPositionIfNecessary):
(WebCore::ScrollAnimatorMac::pinnedInDirection):
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::ensuredView):

The rootContentLayer needs to be offset by the headerHeight().
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateRootLayerPosition):

New member variables m_layerForHeader and m_layerForFooter. This code properly 
creates and manages them.
(WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore):
(WebCore::RenderLayerCompositor::updateLayerForFooter):
(WebCore::RenderLayerCompositor::computeFixedViewportConstraints):
(WebCore::RenderLayerCompositor::reportMemoryUsage):
* rendering/RenderLayerCompositor.h:
(RenderLayerCompositor):

Test infrastructure. 
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::setHeaderHeight):
(WebCore):
(WebCore::Internals::setFooterHeight):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit2: 

New API allows setting and getting layers for a header and footer.

* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/c/mac: Added.
* WebProcess/InjectedBundle/API/c/mac/WKBundlePagePrivateMac.h: Added.
* WebProcess/InjectedBundle/API/c/mac/WKBundlePagePrivateMac.mm: Added.
(WKBundlePageGetHeaderLayer):
(WKBundlePageSetHeaderLayer):
(WKBundlePageGetFooterLayer):
(WKBundlePageSetFooterLayer):
* WebProcess/WebPage/WebPage.h:
(WebPage):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::setTopOverhangImage):
(WebKit::WebPage::setBottomOverhangImage):
(WebKit):
(WebKit::WebPage::getHeaderLayer):
(WebKit::WebPage::setHeaderLayerWithHeight):
(WebKit::WebPage::getFooterLayer):
(WebKit::WebPage::setFooterLayerWithHeight):

LayoutTests: 

* platform/mac-wk2/tiled-drawing/header-and-footer-hit-testing-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/header-and-footer-hit-testing-with-page-scale-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/header-and-footer-hit-testing-with-page-scale.html: Added.
* platform/mac-wk2/tiled-drawing/header-and-footer-hit-testing.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147039 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Set WTF_ARM_ARCH_VERSION to correct value when used with MSVC
https://bugs.webkit.org/show_bug.cgi?id=113436

Reviewed by Benjamin Poulain.

.:

* Source/cmake/OptionsWinCE.cmake: CPU(ARM_TRADITIONAL) is now set correctly by Platform.h.

Source/WTF:

The Microsoft compiler defines _M_ARM with used ARM version.

* wtf/Platform.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147040 268f45cc-cd09-0410-ab3c-d52691b4dbfc