[BlackBerry] Move about: URL handling out of WebCore
https://bugs.webkit.org/show_bug.cgi?id=91541

Patch by Yong Li <yoli@rim.com> on 2012-07-23
Reviewed by Rob Buis.

PR# 181304.
Move about: URL handling to the right place (FrameLoaderClientBlackBerry::createDocumentLoader), so
reload and history navigation can work.
Other changes: Remove about:version which makes little sense. Make about:memory partially visible.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPage::load): Remove the call to loadAbout()
* Api/WebPage_p.h: Remove loadAbout()
(WebPagePrivate):
* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::createDocumentLoader): Construct about: data here.
* WebKitSupport/AboutData.cpp:
(BlackBerry::WebKit::numberToHTMLTr): Make it static
(BlackBerry::WebKit::configPage): Make it static
(BlackBerry::WebKit::memoryPage): Make it static
(BlackBerry::WebKit::cachePage):
(BlackBerry::WebKit::buildPage):
(BlackBerry::WebKit::creditsPage):
(BlackBerry::WebKit::cookiePage):
(BlackBerry::WebKit::aboutData): The only export function that returns HTML source for a given about: URL.
(WebKit):
* WebKitSupport/AboutData.h:
(WebKit):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123391 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r123387.
http://trac.webkit.org/changeset/123387
https://bugs.webkit.org/show_bug.cgi?id=92036

Broke chromium win build (Requested by tony^work on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-07-23

* WebCore.gyp/WebCore.gyp:
* WebCore.gyp/scripts/rule_bison.py:
* bindings/scripts/preprocessor.pm:
(applyPreprocessor):
* make-hash-tools.pl:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123392 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r123169): It made fast/js/dfg-inline-arguments-use-from-uninlined-code.html fail on 32 bit platforms
https://bugs.webkit.org/show_bug.cgi?id=92002

Source/JavaScriptCore: 

Reviewed by Mark Hahnenberg.
        
In the process of changing the nature of local variable typing, I forgot to modify one of the places where
we glue the DFG's notion of variable prediction to the runtime's notion of variable tagging.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compile):

LayoutTests: 

Unskip test that this change fixes, as requested by Ossy.

* platform/qt/Skipped:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG is too aggressive in performing the specific value optimization on loads
https://bugs.webkit.org/show_bug.cgi?id=92034

Reviewed by Mark Hahnenberg.

Source/JavaScriptCore: 

This ensures that we don't do optimizations based on a structure having a specific
value, if there is no way to detect that the value is despecified. This is the
case for dictionaries, since despecifying a value in a dictionary does not lead to
a transition and so cannot be caught by either structure checks or structure
transition watchpoints.

* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeFromLLInt):
(JSC::GetByIdStatus::computeForChain):
(JSC::GetByIdStatus::computeFor):
* bytecode/ResolveGlobalStatus.cpp:
(JSC::computeForStructure):

LayoutTests: 

* fast/js/dfg-resolve-global-polymorphic-non-dictionary-expected.txt: Added.
* fast/js/dfg-resolve-global-polymorphic-non-dictionary.html: Added.
* fast/js/dfg-resolve-global-specific-dictionary-expected.txt: Added.
* fast/js/dfg-resolve-global-specific-dictionary.html: Added.
* fast/js/script-tests/dfg-resolve-global-polymorphic-non-dictionary.js: Added.
(description.foo):
* fast/js/script-tests/dfg-resolve-global-specific-dictionary.js: Added.
(description.foo):
(x):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123394 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix WebGL texSubImage2D for cube maps
https://bugs.webkit.org/show_bug.cgi?id=91927

Patch by Gregg Tavares <gman@google.com> on 2012-07-23
Reviewed by Kenneth Russell.

Source/WebCore:

Fixes texSubImage2D so any size rectangle can be passed in
for cube maps.

Test: fast/canvas/webgl/tex-sub-image-cube-maps.html

* html/canvas/WebGLRenderingContext.cpp:
(WebCore):
(WebCore::WebGLRenderingContext::copyTexImage2D):
(WebCore::WebGLRenderingContext::texImage2DBase):
(WebCore::WebGLRenderingContext::texSubImage2DBase):
(WebCore::WebGLRenderingContext::validateTexFuncParameters):
* html/canvas/WebGLRenderingContext.h:
(WebGLRenderingContext):

LayoutTests:

Tests for WebGL texSubImage2D for cube maps.

* fast/canvas/webgl/tex-sub-image-cube-maps-expected.txt: Added.
* fast/canvas/webgl/tex-sub-image-cube-maps.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Report the extra memory used by immutable StylePropertySet objects.
<http://webkit.org/b/92032>

Reviewed by Anders Carlsson.

Add an optional parameter to the MemoryClassInfo constructor for passing in additional base object
size on top of sizeof(T).

Use this in StylePropertySet::reportMemoryUsage() to properly account for the CSSProperty array
tacked onto the end of the object when m_isMutable == false.

* css/StylePropertySet.h:
(WebCore::StylePropertySet::reportMemoryUsage):
* dom/MemoryInstrumentation.h:
(WebCore::MemoryObjectInfo::reportObjectInfo):
(WebCore::MemoryClassInfo::MemoryClassInfo):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123396 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] svg/{in-html,overflow,repaint,wicd} needs update after new testfonts
https://bugs.webkit.org/show_bug.cgi?id=92023

Unreviewed gardening.

* platform/qt-5.0/Skipped:
* platform/qt-5.0/svg/wicd/test-rightsizing-b-expected.png: Removed.
* platform/qt-5.0/svg/wicd/test-rightsizing-b-expected.txt: Removed.
* platform/qt/Skipped:
* platform/qt/svg/in-html/by-reference-expected.txt:
* platform/qt/svg/in-html/circle-expected.png:
* platform/qt/svg/in-html/circle-expected.txt:
* platform/qt/svg/overflow/overflow-on-foreignObject-expected.png:
* platform/qt/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-auto-expected.txt:
* platform/qt/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-defaults-expected.txt:
* platform/qt/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-hidden-expected.txt:
* platform/qt/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-scroll-expected.txt:
* platform/qt/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-visible-expected.txt:
* platform/qt/svg/repaint/inner-svg-change-viewBox-contract-expected.png: Copied from LayoutTests/platform/qt/svg/overflow/overflow-on-foreignObject-expected.png.
* platform/qt/svg/repaint/inner-svg-change-viewBox-contract-expected.txt: Added.
* platform/qt/svg/repaint/inner-svg-change-viewBox-expected.png: Added.
* platform/qt/svg/repaint/inner-svg-change-viewBox-expected.txt: Added.
* platform/qt/svg/repaint/inner-svg-change-viewPort-relative-expected.txt:
* platform/qt/svg/repaint/mask-clip-target-transform-expected.png: Added.
* platform/qt/svg/repaint/text-mask-update-expected.png: Copied from LayoutTests/platform/qt/svg/overflow/overflow-on-foreignObject-expected.png.
* platform/qt/svg/repaint/text-mask-update-expected.txt: Added.
* platform/qt/svg/wicd/rightsizing-grid-expected.png:
* platform/qt/svg/wicd/rightsizing-grid-expected.txt:
* platform/qt/svg/wicd/sizing-flakiness-expected.txt:
* platform/qt/svg/wicd/test-rightsizing-a-expected.png:
* platform/qt/svg/wicd/test-rightsizing-a-expected.txt:
* platform/qt/svg/wicd/test-rightsizing-b-expected.png:
* platform/qt/svg/wicd/test-rightsizing-b-expected.txt:
* platform/qt/svg/wicd/test-scalable-background-image1-expected.png:
* platform/qt/svg/wicd/test-scalable-background-image1-expected.txt:
* platform/qt/svg/wicd/test-scalable-background-image2-expected.png:
* platform/qt/svg/wicd/test-scalable-background-image2-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123397 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Fix unit tests in debug mode after r123375
https://bugs.webkit.org/show_bug.cgi?id=92030

Reviewed by Adrienne Walker.

Fixed two unit tests that were causing debug assertions because
they gave calcDrawTransforms an empty sized root layer.

* tests/CCLayerTreeHostCommonTest.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123398 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use the original token to create an element in "reconstruct the active formatting elements" and "call the adoption agency"
https://bugs.webkit.org/show_bug.cgi?id=91703

Reviewed by Adam Barth.

Source/WebCore:

The current WebKit HTML5 parser implementation does not hold the original token
in the stack of open elements and the active formatting elements. This is
problematic because the original token is used to create an element in
"reconstruct the active formatting elements" and "call the adoption agency".

As a workaround, WebKit uses the saved element instead of the original token
to create an element. But this causes us to fail examples like this:
<b id="1"><p><script>document.getElementById("1").id = "2"</script></p>TEXT</b>
reconstructTheActiveFormattingElements calls this method to open a second <b>
tag to wrap TEXT, it will have id "2", even though the HTML5 spec implies it
should be "1".

Created a ref-counted container class, HTMLStackItem to hold the original token
and the namespace URI as well as the element. Changed HTMLElementStack and
HTMLFormattingElementList to use HTMLStackItem.
Changed HTMLConstructionSite::reconstructTheActiveFormattingElements and
HTMLTreeBuilder::callTheAdoptionAgency to create an element from the saved token
instead of the saved element.

Updated test expectation for html5lib/runner-expected.txt
because now resources/scripted/adoption01.dat passes.

* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML):
(WebCore::HTMLConstructionSite::insertHTMLHeadElement):
(WebCore::HTMLConstructionSite::insertHTMLBodyElement):
(WebCore::HTMLConstructionSite::insertHTMLFormElement):
(WebCore::HTMLConstructionSite::insertHTMLElement):
(WebCore::HTMLConstructionSite::insertFormattingElement):
(WebCore::HTMLConstructionSite::insertScriptElement):
(WebCore::HTMLConstructionSite::insertForeignElement):
(WebCore::HTMLConstructionSite::createElementFromSavedToken):
(WebCore::HTMLConstructionSite::reconstructTheActiveFormattingElements):
* html/parser/HTMLConstructionSite.h:
(HTMLConstructionSite):
(WebCore::HTMLConstructionSite::currentElementRecord):
* html/parser/HTMLElementStack.cpp:
(WebCore::HTMLElementStack::ElementRecord::ElementRecord):
(WebCore::HTMLElementStack::ElementRecord::replaceElement):
(WebCore::HTMLElementStack::pushRootNode):
(WebCore::HTMLElementStack::pushHTMLHtmlElement):
(WebCore::HTMLElementStack::pushRootNodeCommon):
(WebCore::HTMLElementStack::pushHTMLHeadElement):
(WebCore::HTMLElementStack::pushHTMLBodyElement):
(WebCore::HTMLElementStack::push):
(WebCore::HTMLElementStack::insertAbove):
(WebCore::HTMLElementStack::pushCommon):
* html/parser/HTMLElementStack.h:
(WebCore::HTMLElementStack::ElementRecord::element):
(WebCore::HTMLElementStack::ElementRecord::node):
(WebCore::HTMLElementStack::ElementRecord::stackItem):
(ElementRecord):
(HTMLElementStack):
* html/parser/HTMLFormattingElementList.cpp:
(WebCore::HTMLFormattingElementList::swapTo):
(WebCore::HTMLFormattingElementList::append):
* html/parser/HTMLFormattingElementList.h:
(WebCore::HTMLFormattingElementList::Entry::Entry):
(WebCore::HTMLFormattingElementList::Entry::isMarker):
(WebCore::HTMLFormattingElementList::Entry::stackItem):
(WebCore::HTMLFormattingElementList::Entry::element):
(WebCore::HTMLFormattingElementList::Entry::replaceElement):
(WebCore::HTMLFormattingElementList::Entry::operator==):
(WebCore::HTMLFormattingElementList::Entry::operator!=):
(Entry):
(HTMLFormattingElementList):
* html/parser/HTMLStackItem.h: Added.
(WebCore):
(HTMLStackItem):
(WebCore::HTMLStackItem::create):
(WebCore::HTMLStackItem::element):
(WebCore::HTMLStackItem::node):
(WebCore::HTMLStackItem::token):
(WebCore::HTMLStackItem::namespaceURI):
(WebCore::HTMLStackItem::HTMLStackItem):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
(WebCore::HTMLTreeBuilder::processStartTag):
(WebCore::HTMLTreeBuilder::callTheAdoptionAgency):

LayoutTests:

Updated test expectation for html5lib/runner-expected.txt
because now resources/scripted/adoption01.dat passes.

* html5lib/runner-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update website for new hardware.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123400 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed chromium expectations change to mark test as slow: fast/forms/select-set-length-with-mutation-remove.html.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123401 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Implement scrollbar theme for Android
https://bugs.webkit.org/show_bug.cgi?id=91674

Patch by Tien-Ren Chen <trchen@chromium.org> on 2012-07-23
Reviewed by Adam Barth.

Previously the scrollbar for Android was implemented as an extra
drawing pass in the compositor. Now we switch to use the standard
ScrollbarTheme mechanism.

No new tests. We use mock scrollbars during layout test to share
pixel results with Linux.

* platform/chromium/ScrollbarThemeChromiumAndroid.cpp:
(WebCore::ScrollbarThemeChromiumAndroid::scrollbarThickness):
(WebCore::ScrollbarThemeChromiumAndroid::thumbPosition):
(WebCore::ScrollbarThemeChromiumAndroid::thumbLength):
(WebCore::ScrollbarThemeChromiumAndroid::backButtonRect):
(WebCore::ScrollbarThemeChromiumAndroid::forwardButtonRect):
(WebCore::ScrollbarThemeChromiumAndroid::trackRect):
(WebCore):
(WebCore::ScrollbarThemeChromiumAndroid::paintThumb):
(WebCore::ScrollbarThemeChromiumAndroid::paintScrollbarBackground):
* platform/chromium/ScrollbarThemeChromiumAndroid.h:
(WebCore::ScrollbarThemeChromiumAndroid::usesOverlayScrollbars):
(ScrollbarThemeChromiumAndroid):
(WebCore::ScrollbarThemeChromiumAndroid::hasButtons):
(WebCore::ScrollbarThemeChromiumAndroid::hasThumb):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123402 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Land pixel results for fast/frames/valid.html on chromium mac snowleopard.

* fast/frames/valid-expected.txt: Renamed from LayoutTests/platform/efl/fast/frames/valid-expected.txt.
* platform/chromium-mac-snowleopard/fast/frames/valid-expected.png: Added.
* platform/chromium/TestExpectations:
* platform/gtk/fast/frames/valid-expected.txt: Removed.
* platform/mac/fast/frames/valid-expected.txt: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123403 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] css3/selectors3 rebaseline after new test fonts
https://bugs.webkit.org/show_bug.cgi?id=92038

Reviewed by Alexis Menard.

* platform/qt-5.0-wk1/Skipped:
* platform/qt-5.0-wk2/Skipped: These tests are failing because of <input> default size in
WK2, which is different than the expected results generated from WK1. Moved them to
appropriate block in skipped list.
* platform/qt-5.0/Skipped:
* platform/qt/css3/selectors3/html/css3-modsel-21c-expected.png:
* platform/qt/css3/selectors3/html/css3-modsel-21c-expected.txt:
* platform/qt/css3/selectors3/xhtml/css3-modsel-21c-expected.png:
* platform/qt/css3/selectors3/xhtml/css3-modsel-21c-expected.txt:
* platform/qt/css3/selectors3/xml/css3-modsel-148-expected.png:
* platform/qt/css3/selectors3/xml/css3-modsel-148-expected.txt:
* platform/qt/css3/selectors3/xml/css3-modsel-21c-expected.png:
* platform/qt/css3/selectors3/xml/css3-modsel-21c-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123404 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Exclusions] SVG shape errors should invalidate exclusion shapes
https://bugs.webkit.org/show_bug.cgi?id=91761

Patch by Bem Jones-Bey <bjonesbe@adobe.com> on 2012-07-23
Reviewed by Andreas Kling.

Source/WebCore:

CSS exclusion shapes that are specified with negative radiuses or
height/width are now considered invalid and ignored.

Tests added to
LayoutTests/fast/exclusions/parsing-wrap-shape-lengths.html

* css/CSSParser.cpp:
(WebCore::CSSParser::parseExclusionShapeRectangle):
(WebCore::CSSParser::parseExclusionShapeCircle):
(WebCore::CSSParser::parseExclusionShapeEllipse):

LayoutTests:

Test that negative heights. widths, and radiuses are ignored.

* fast/exclusions/parsing-wrap-shape-lengths-expected.txt:
* fast/exclusions/parsing-wrap-shape-lengths.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123405 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Null-pointer crash when parsing border-image
https://bugs.webkit.org/show_bug.cgi?id=91963

Patch by Douglas Stockwell <dstockwell@google.com> on 2012-07-23
Reviewed by Darin Adler.

Source/WebCore:

Test: fast/css/border-image-fill-crash.html

* css/CSSParser.cpp:
(WebCore::CSSParser::parseBorderImageRepeat): Handle the case where
parseBorderImageRepeat is called when the value list is empty.

LayoutTests:

* fast/css/border-image-fill-crash-expected.txt: Added.
* fast/css/border-image-fill-crash.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123406 268f45cc-cd09-0410-ab3c-d52691b4dbfc
A FocusScope for a distributed node should not be its TreeScope.
https://bugs.webkit.org/show_bug.cgi?id=91829

Reviewed by Dimitri Glazkov.

Source/WebCore:

Current implementation of FocusScope::focusScopeOf(Node*) returns
the given node's treeScope().  That does not apply if the node is
a distributed node.  We should calculate a FocusScope for a
distributed node by traversing ancestor nodes in Composed Shadow
Tree.

Test: fast/dom/shadow/focus-navigation-with-distributed-nodes.html

* page/FocusController.cpp:
(WebCore::FocusScope::focusScopeOf):

LayoutTests:

* fast/dom/shadow/focus-navigation-with-distributed-nodes-expected.txt: Added.
* fast/dom/shadow/focus-navigation-with-distributed-nodes.html: Added.
* fast/dom/shadow/resources/shadow-dom.js:
(shouldNavigateFocus):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123407 268f45cc-cd09-0410-ab3c-d52691b4dbfc
http/tests/multipart/policy-ignore-crash.php is failing on Chromium
https://bugs.webkit.org/show_bug.cgi?id=92046

Reviewed by Adam Barth.

Chromium's network layer now shows most text/* mime types. This test was using text/random to
try to trigger a crash when multipart content switch from a text type to a non-text type.
Change the test to use a text type that we don't render.

* http/tests/multipart/policy-ignore-crash.php: Use text/rtf instead of text/random.
* platform/chromium/TestExpectations: Test should be passing again.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fixed crash in webkitAddKey() when key parameter is null.
https://bugs.webkit.org/show_bug.cgi?id=85444

Patch by David Dorwin <ddorwin@chromium.org> on 2012-07-23
Reviewed by Kentaro Hara.

Reference: Step 1 of http://dvcs.w3.org/hg/html-media/raw-file/5f76a0b43836/encrypted-media/encrypted-media.html#dom-addkey

Source/WebCore:

Tests: media/encrypted-media/encrypted-media-syntax.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::webkitAddKey):

LayoutTests:

* media/encrypted-media/encrypted-media-syntax-expected.txt:
* media/encrypted-media/encrypted-media-syntax.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123409 268f45cc-cd09-0410-ab3c-d52691b4dbfc
.: If select element in Windows is off screen horizontally,
menu is either inappropriately resized or positioned offscreen.
https://bugs.webkit.org/show_bug.cgi?id=91913
<rdar://problem/7611229>

Patch by Roger Fong <roger_fong@apple.com> on 2012-07-23
Reviewed by Tim Horton.

Add a manual test to verify that popup menus render in the correct place.

* ManualTests/win/select-menu-off-screen.html: Added.

Source/WebCore: On Windows, if select element is off screen horizontally,
menu is either inappropriately resized or positioned offscreen.
https://bugs.webkit.org/show_bug.cgi?id=91913
<rdar://problem/7611229>

Patch by Roger Fong <roger_fong@apple.com> on 2012-07-23
Reviewed by Tim Horton.

If the select element is positioned off the edge of the screen to the left,
the menu is resized. It should not be resized, just shifted to remain on the screen.
If the select element is positioned off the edge of the screen to the right,
the menu goes off screen instead of being shifted over to appear on screen.
This problem only occurs on Windows.

Test: ManualTests/win/select-menu-off-screen.html

* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::calculatePositionAndSize):
Modified final horizontal position calculation code to position
popup menu on screen if it would otherwise go off.

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