[BlackBerry] Add a check to filter out cookies that tries to set the
domain to a top level domain
https://bugs.webkit.org/show_bug.cgi?id=94722

Patch by Otto Derek Cheung <otcheung@rim.com> on 2012-08-22
Reviewed by Rob Buis.

Adding conditions to check whether a cookie domain is a top level domain.
If it is, throw it out when parsing.

Manual Testing by trying to insert a cookie with an invalid domain
using web-inspector. (ex: when on news.yahoo.com.hk, try to document.
cookie="test1=seeifthiscookieexist; domain=.com.hk")

PR121622

* platform/blackberry/CookieParser.cpp:
WebCore::CookieParser::parseOneCookie):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126336 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Skipping css3/flexbox/flexitem.html.
https://bugs.webkit.org/show_bug.cgi?id=94723.

Patch by Mark Lam <mark.lam@apple.com> on 2012-08-22
Reviewed by Simon Fraser.

* platform/mac/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126337 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Make all pickers non-zoomable
https://bugs.webkit.org/show_bug.cgi?id=94729

Patch by Crystal Zhang <haizhang@rim.com> on 2012-08-22
Reviewed by Antonio Gomes.

Move HTML header initialization to PagePopupBlackBerry as that part are all the same, and make all pickers non-zoomable.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::screenSize):
(WebKit):
* Api/WebPage_p.h:
(WebPagePrivate):
* WebCoreSupport/DatePickerClient.cpp:
(WebCore::DatePickerClient::generateHTML):
(WebCore::DatePickerClient::writeDocument):
* WebCoreSupport/PagePopupBlackBerry.cpp:
(WebCore::PagePopupBlackBerry::init):
(WebCore::PagePopupBlackBerry::generateHTML):
(WebCore):
* WebCoreSupport/PagePopupBlackBerry.h:
(PagePopupBlackBerry):
* WebCoreSupport/SelectPopupClient.cpp:
(WebCore::SelectPopupClient::generateHTML):
(WebCore::SelectPopupClient::writeDocument):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126338 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Simplify updateContentRect, removing rect parameter, refactor unit tests.
https://bugs.webkit.org/show_bug.cgi?id=94165

Patch by Eric Penner <epenner@google.com> on 2012-08-22
Reviewed by Adrienne Walker.

Source/WebCore:

Remove visible rect parameter from TiledLayerChromium functions. Passing a
rect that is not the visible rect wouldn't make sense, and soon we might
need further visibility information.

In refactoring the unit tests, I removed texture manager from all tests
and put it in the test class. I also made some utility functions to
simulate the commit flow and remove tons of boilerplate code. I refactored
about half the unit tests to use the utility functions.

Refactored tests.

* platform/graphics/chromium/ContentLayerChromium.cpp:
(WebCore::ContentLayerChromium::update):
(WebCore::ContentLayerChromium::needMoreUpdates):
* platform/graphics/chromium/ImageLayerChromium.cpp:
(WebCore::ImageLayerChromium::update):
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore):
(WebCore::TiledLayerChromium::setTexturePriorities):
(WebCore::TiledLayerChromium::resetUpdateState):
(WebCore::TiledLayerChromium::update):
(WebCore::TiledLayerChromium::needsIdlePaint):
(WebCore::TiledLayerChromium::idlePaintRect):
* platform/graphics/chromium/TiledLayerChromium.h:
(TiledLayerChromium):

Source/WebKit/chromium:

Refactored tests to remove lots of boilerplate code.

* tests/CCTiledLayerTestCommon.cpp:
* tests/CCTiledLayerTestCommon.h:
(FakeTiledLayerChromium):
* tests/TiledLayerChromiumTest.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] MediaStream API: Add MockWebRTCPeerConnectionHandler
https://bugs.webkit.org/show_bug.cgi?id=93091

Reviewed by Adam Barth.

Source/WebCore:

Fixing a FIXME that the patch obsoletes.

Covered by existing tests.

* platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp:
(WebCore::RTCPeerConnectionHandlerChromium::initialize):

Tools:

Add a skeleton MockWebRTCPeerConnectionHandler to DumpRenderTree,
to complete the infrastructure for RTCPeerConnection.

* DumpRenderTree/DumpRenderTree.gypi:
* DumpRenderTree/chromium/MockWebKitPlatformSupport.cpp:
(MockWebKitPlatformSupport::createRTCPeerConnectionHandler):
* DumpRenderTree/chromium/MockWebKitPlatformSupport.h:
(MockWebKitPlatformSupport):
* DumpRenderTree/chromium/MockWebMediaStreamCenter.cpp:
* DumpRenderTree/chromium/MockWebMediaStreamCenter.h:
* DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp: Copied from Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.h.
(MockWebRTCPeerConnectionHandler::MockWebRTCPeerConnectionHandler):
(MockWebRTCPeerConnectionHandler::initialize):
* DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h: Copied from Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.h.
(WebKit):
(MockWebRTCPeerConnectionHandler):
(MockWebRTCPeerConnectionHandler::MockWebRTCPeerConnectionHandler):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126341 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebGL] Mac/ATI/AMD systems need to translate built-in GLSL functions
https://bugs.webkit.org/show_bug.cgi?id=94030

Reviewed by Tim Horton.

ATI/AMD GPUs on Apple platforms do not give correct values for some of
the built-in GLSL functions. Add a compile flag that is passed to ANGLE
so that, with this configuration, it will rewrite the shader to emulate
the function in code.

This is exposing some design weaknesses in the way we call ANGLE. We'll
soon need to add more compiler flags; Future bugs will likely clean
this code up. But this approach is satisfactory for the moment.

This change is tested by the Khronos WebGL conformance test suite, in particular:
conformance/glsl/functions/glsl-function-distance.html
conformance/glsl/functions/glsl-function-dot.html
conformance/glsl/functions/glsl-function-length.html

* platform/graphics/ANGLEWebKitBridge.cpp:
(WebCore::ANGLEWebKitBridge::validateShaderSource): Test for ATI cards
on the Mac platform, and pass in an extra flag to the translation step.
* platform/graphics/ANGLEWebKitBridge.h:
(ANGLEWebKitBridge): Add a new parameter to getTranslatedShaderSourceANGLE
that accepts some extra options to pass to ANGLE.
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE): Pass
the extra options into ANGLE's compile function.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126342 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=94401
Add support for making a web site become paginated using overflow: 
paged-x | paged-y
-and corresponding-
<rdar://problem/11831783> 

Reviewed by Dave Hyatt.

.: 

* Source/autotools/symbols.filter:

Source/WebCore: 

This patch adds two new possible values for overflow-y. They are -
webkit-paged-x and -webkit-paged-y. When you set these as overflow-y 
values on the html or body element, they make the RenderView 
paginated, much like the API on Page.

-webkit-paged-x and -webkit-paged-y are only valid values for 
overflow-y, NOT overflow-x. overflow-x defaults to a value of auto 
(for now) unless it has been set to something else.
* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::CSSParser::parseValue):

Two new CSS value keywords.
* css/CSSValueKeywords.in:

EOverflow has two new values for pagination. 
* rendering/style/RenderStyleConstants.h:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator EOverflow):

A bunch of existing code from StyleResolver::styleForDocument() is 
moved into a helper function so that it can be called from two 
places. 
* css/StyleResolver.cpp:
(WebCore::StyleResolver::collectMatchingRulesForList):

Even though this pagination is very similar to Page::pagination(), it 
is different in one critical way. Page::pagination() will apply to 
all FrameViews, even those in the page cache. For this reason, 
FrameView needs to keep its own Pagination value that just applies to 
this FrameView.
* page/FrameView.cpp:
* page/FrameView.h:
(WebCore):
(FrameView):

Map RenderStyle values to a Pagination::Mode.
(WebCore::paginationModeForRenderStyle):
(WebCore):

Account for paged-x and paged-y here.
(WebCore::FrameView::applyOverflowToViewport):

As is explained in the header, FrameView::pagination() will return 
m_pagination if it has been set. Otherwise, it will return 
Page::pagination() since currently there are no callers that need to 
distinguish between the two.
(WebCore::FrameView::pagination):
(WebCore::FrameView::setPagination):

Generally this means that everywhere in WebCore should ask FrameView 
for the pagination(), not Page. These call sites all look to 
FrameView now.
(WebCore::FrameView::paintContents):
* rendering/RenderView.cpp:
(WebCore::RenderView::requiresColumns):
(WebCore::RenderView::calcColumnWidth):
(WebCore::RenderView::paginationUnit):
(WebCore::RenderView::viewLogicalHeight):

Since we need to define Pagination in Page.h AND FrameView.h, it is 
now in its own header, Pagination.h. And therefore it is no longer 
WebCore::Page::Pagination, but rather it is just WebCore::Pagination.
* page/Page.h:
(Page):
* rendering/Pagination.h: Added.
(WebCore):
(WebCore::Pagination::Pagination):
(Pagination):
(WebCore::Pagination::operator==):
(WebCore::Pagination::operator!=):
* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.exp.in:
* WebCore.gypi:

Certain ColumnInfo values are set based on the RenderStyle. So if 
those RenderStyle values change, the ColumnInfo needs to be updated.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::updateColumnInfoFromStyle):
(WebCore):
* rendering/RenderBlock.h:
(RenderBlock):

Factor in paged-x and paged-y when determining if a RenderBlock 
requires columns.
(WebCore::RenderBlock::requiresColumns):

RenderStyle::specifiesColumns() is an odd and probably broken 
function. At the very least, it should be re-named, if not removed 
entirely. It does not accurately assess if columns have been 
specified. I had to add this code here because specifiesColumns() 
returns false for paged-x and true for paged-y. We were hitting a 
number of crashes with paged-y because of this, so I chose for the 
time being to limit this check to non-root layers.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::shouldBeNormalFlowOnly):

It's just Pagination now, not Page::Pagination.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::reset):
(WebCore::InternalSettings::setPagination):

Source/WebKit/mac: 

WebCore::Page::Pagination is now just WebCore::Pagination.
* WebView/WebView.mm:
(-[WebView _setPaginationMode:]):
(-[WebView _paginationMode]):
(-[WebView _setPaginationBehavesLikeColumns:]):
(-[WebView _setPageLength:]):
(-[WebView _setGapBetweenPages:]):

Source/WebKit2: 

WebCore::Page::Pagination is now just WebCore::Pagination.
* Shared/WebPageCreationParameters.h:
(WebPageCreationParameters):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPaginationMode):
(WKPageGetPaginationMode):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::setPaginationMode):
* UIProcess/WebPageProxy.h:
(WebPageProxy):
(WebKit::WebPageProxy::paginationMode):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setPaginationMode):
(WebKit::WebPage::setPaginationBehavesLikeColumns):
(WebKit::WebPage::setPageLength):
(WebKit::WebPage::setGapBetweenPages):
* WebProcess/WebPage/WebPage.h:
(WebPage):

LayoutTests: 

Test the parsing of the two new values.
* fast/css/overflow-property-expected.txt:
* fast/css/overflow-property.html:

New tests.
* fast/overflow/paged-x-div.html: Added.
* fast/overflow/paged-x-on-root.html: Added.
* fast/overflow/paged-y-div.html: Added.
* fast/overflow/paged-y-on-root.html: Added.
* platform/mac/fast/overflow/paged-x-div-expected.png: Added.
* platform/mac/fast/overflow/paged-x-div-expected.txt: Added.
* platform/mac/fast/overflow/paged-x-on-root-expected.png: Added.
* platform/mac/fast/overflow/paged-x-on-root-expected.txt: Added.
* platform/mac/fast/overflow/paged-y-div-expected.png: Added.
* platform/mac/fast/overflow/paged-y-div-expected.txt: Added.
* platform/mac/fast/overflow/paged-y-on-root-expected.png: Added.
* platform/mac/fast/overflow/paged-y-on-root-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126343 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebWidget should be able to paint into a zoomed canvas without aliasing
https://bugs.webkit.org/show_bug.cgi?id=92043

Reviewed by James Robinson.

If accelerated compositing is enabled, WebWidget::paint reads back from
the compositor rather than re-painting the widget. That approach works
well if the canvas we're rendering into is at a similar resolution to
the pixels in the compositor, but if the canvas has been scaled (e.g.,
to help the user disambiguate links), then reading back from the
compositor will cause aliasing artifacts.

This patch adds an option to paint to let the embedder request a
software re-rendering of the widget to avoid these aliasing artifacts.

* public/WebWidget.h:
(WebKit::WebWidget::paint):
* src/WebPagePopupImpl.cpp:
(WebKit::WebPagePopupImpl::paint):
* src/WebPagePopupImpl.h:
(WebPagePopupImpl):
* src/WebPopupMenuImpl.cpp:
(WebKit::WebPopupMenuImpl::paint):
* src/WebPopupMenuImpl.h:
* src/WebViewImpl.cpp:
(WebKit::canvasBackgroundForTransparencey):
(WebKit):
(WebKit::WebViewImpl::paint):
* src/WebViewImpl.h:
(WebViewImpl):


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