CSSComputedStyleDeclaration::cssText() should use StringBuilder
https://bugs.webkit.org/show_bug.cgi?id=93776

Reviewed by Eric Seidel.

String::append() is fairly inefficient when used to create a long string by appending a lot of small
pieces. StringBuilder is more approriate for the kind of operations done by CSSComputedStyleDeclaration::cssText().

This changes makes CSSComputedStyleDeclaration::cssText() about 6 times faster.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::cssText):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125367 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move CSS's propertyNameStrings[] to from the header to the cpp file
https://bugs.webkit.org/show_bug.cgi?id=93771

Reviewed by Eric Seidel.

The names of propertyNameStrings[] should never be accessed directly. The function getPropertyName()
return the correct string of propertyNameStrings.

To ensure the values are not accessed by mistake, move them from the header to the implementation.

* css/makeprop.pl:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125368 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][UT] Delete shutdown method.
https://bugs.webkit.org/show_bug.cgi?id=90785

Patch by Krzysztof Czech <k.czech@samsung.com> on 2012-08-12
Reviewed by Eric Seidel.

EWKTestBase class already has a shutdownAll method that can be used instead of shutdown.

* tests/UnitTestUtils/EWKTestBase.cpp:
* tests/UnitTestUtils/EWKTestBase.h:
(EWKTestBase):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125369 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix build with recent clang.
https://bugs.webkit.org/show_bug.cgi?id=90701

Patch by Nuno Lopes <nlopes@apple.com> on 2012-08-12
Reviewed by Eric Seidel.

* Shared/CommandLine.h:
(CommandLine):
* WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
(WebKit::NotificationPermissionRequestManager::NotificationPermissionRequestManager):
* WebProcess/Notifications/NotificationPermissionRequestManager.h:
(NotificationPermissionRequestManager):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125370 268f45cc-cd09-0410-ab3c-d52691b4dbfc
webkit fails IETC namespaces/prefix-007.xml
https://bugs.webkit.org/show_bug.cgi?id=86137

Patch by Takashi Sakamoto <tasak@google.com> on 2012-08-12
Reviewed by Eric Seidel.

Source/WebCore:

If a namespace prefix or default namespace is declared more than once
only the last declaration shall be used.

parseAddNamespace doesn't check return value of WTF::HashMap<>::add.
If the return value's isNewEntry is true, the new entry is added with
the specified value. However, if isNewEntry is false, it is required
to update the store value.

No new tests. ietestcenter/css3/namespaces/prefix-007.xml and
ietestcenter/css3/namespaces/prefix-010.xml covers this change.

* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parserAddNamespace):
Modified to check m_namespaces.add's return value.
If the result says not a new entry, updated the value stored in
m_namespaces by using iterator in the result.

LayoutTests:

* platform/chromium/TestExpectations:
Enabled the layout tests, ietestcenter/css3/namespaces/prefix-007.xml
and ietestcenter/css3/namespaces/prefix-010.xml.
* platform/win/ietestcenter/css3/namespaces/prefix-007-expected.txt: Removed.
* platform/win/ietestcenter/css3/namespaces/prefix-010-expected.txt: Removed.
Removed old expectations.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125371 268f45cc-cd09-0410-ab3c-d52691b4dbfc
master.cfg unittest cleanup: Show DeprecationWarnings with python >= 2.7 too
https://bugs.webkit.org/show_bug.cgi?id=90161

Reviewed by Eric Seidel.

* BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125372 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Doesn't build with ENABLE_JIT=0
https://bugs.webkit.org/show_bug.cgi?id=85042

Reviewed by Eric Seidel.

Include headers without which CallFrame.h does not build, and
fix gcc warning about comparing unsigned int with 0.

* dfg/DFGDriver.cpp:
* interpreter/Interpreter.cpp:
(JSC::Interpreter::isOpcode):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125373 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Set the access qualifier of two methods to query frame specific info of BitmapImage to protected.
https://bugs.webkit.org/show_bug.cgi?id=90505

Patch by Huang Dongsung <luxtella@company100.net> on 2012-08-12
Reviewed by Eric Seidel.

Following 4 methods are protected.
  size_t frameCount();
  NativeImagePtr frameAtIndex(size_t);
  bool frameIsCompleteAtIndex(size_t);
  float frameDurationAtIndex(size_t);

So, 2 methds also should be protected because the frame info is only specific of
BitmapImage.
  bool frameHasAlphaAtIndex(size_t);
  ImageOrientation frameOrientationAtIndex(size_t);

On the other hand, this patch amended GraphicsContext3DCG.
- static_cast<BitmapImage*>(image)->frameHasAlphaAtIndex(0)
+ image->currentFrameHasAlpha()

This patch does not affect PNG, JPEG, BMP, and WEBP because those images
have only 0 indexed frame.
Thus, GIF, and ICO are affected. However, an above query to get Alpha
is for the image that is created by image->nativeImageForCurrentFrame(), so it
is proper to use image->currentFrameHasAlpha() instead of
image->frameHasAlphaAtIndex(0).

No new tests, because it is hard to test. We need an animated GIF that
one frame has alpha and another frame does not have alpha. However, I
cannot find the animated GIF file that suffices the requirement.

* platform/graphics/BitmapImage.h:
(BitmapImage):
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::GraphicsContext3D::getImageData):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Skip webintents/web-intents-obj-constructor.html test
https://bugs.webkit.org/show_bug.cgi?id=93778

Unreviewed EFL gardening.

Skip webintents/web-intents-obj-constructor.html for
WebKit2 EFL until WTR can print information about the
MessagePorts in a Web Intent (Bug 89072).

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-08-12

* platform/efl-wk2/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125375 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSSRegions: Crash when using style in region for removed element.
https://bugs.webkit.org/show_bug.cgi?id=93276

Reviewed by Abhishek Arya.

Source/WebCore:

When a RenderInline object from within a render flow thread is split, the cloned
hierarchy built during the split process does not have the inRenderFlowThread bit
set properly. If the cloned hierarchy is flowed into a region with region style rules,
we compute the style in region also for objects that do not have inRenderFlowThread bit
set and we store the computed style in region for caching purposes. But we only remove
an object style in region information if that object has the inRenderFlowThread bit set.
Under these circumstances, it is possible to remove a object with cached style in region
and without inRenderFlowThread bit set from the render tree and leave the associated cached
information un-removed. Such information will be accesses during the next paint phase of
the region, thus resulting a crash.

The fix is to modify RenderBlock::clone() and RenderInline::clone() functions to also copy the inRenderFlowThread bit
from the source into the clone, therefore the cloned hierarchies will have the inRenderFlowThread
bit set properly.

Test: fast/regions/removed-element-style-in-region-crash.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::clone):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::clone): Replace former static RenderInline::cloneInline with member RenderInline::clone.
(WebCore::RenderInline::splitInlines):
* rendering/RenderInline.h:
(RenderInline):
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::setObjectStyleInRegion):
Added an assert to make sure that when we are computing style in region, we are doing for objects
with inRenderFlowThread set. Also, bail out early in this case to prevent further crashes.

LayoutTests:

Added test reproducing the problem.

* fast/regions/removed-element-style-in-region-crash-expected.txt: Added.
* fast/regions/removed-element-style-in-region-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125376 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Make it possible to build without QtTest/QtPrintSupport
https://bugs.webkit.org/show_bug.cgi?id=93492

Patch by Loïc Yhuel <loic.yhuel@softathome.com> on 2012-08-12
Reviewed by Tor Arne Vestbø.

.:

* Source/QtWebKit.pro: Disable tests if no testlib

Source/WebKit:

* WebKit1.pri: Optional printsupport

Source/WebKit/qt:

* Api/qwebframe.cpp:
(QWebFrame::print): Does nothing if no printsupport
* Api/qwebview.cpp:
(QWebView::print): Does nothing if no printsupport

Tools:

* DumpRenderTree/qt/DumpRenderTree.pro: Optional printsupport
* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore):
(WebCore::DumpRenderTree::dryRunPrint): Does nothing if no printsupport
* QtTestBrowser/QtTestBrowser.pro: Optional printsupport
* QtTestBrowser/launcherwindow.cpp:
(LauncherWindow::createChrome): No print menu if no printsupport
(LauncherWindow::print): Does nothing if no printsupport
* QtTestBrowser/launcherwindow.h:
* Tools.pro: Disable DRT/WTR if QtTest not present
* qmake/mkspecs/features/default_pre.prf: printsupport no more mandatory
* qmake/mkspecs/features/features.prf: Qt module availability tests

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125377 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Stop Y-flipping CROS/ARM video textures
https://bugs.webkit.org/show_bug.cgi?id=93769

Reviewed by Eric Seidel.

No new tests; there's no cros/arm bot yet, sadly.

* platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
(WebCore::CCVideoLayerImpl::appendQuads): drop the single-platform Y-flipping in prep for the platform doing the flip natively.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Implement the find-in-page match rects API
https://bugs.webkit.org/show_bug.cgi?id=93111

Reviewed by Adam Barth.

Source/WebCore:

Introduce the find-in-page coordinate system. This system tries to solve
the unintuitive tickmark results presented in pages with multiple frames
and scrolled contents where the find results might not be in the visible
area of a frame, which might lead to tickmarks below the container frame.

To achieve this, this coordinate system goes up the render tree
normalizing the coordinates by the actual contents size of its container.
This leads to tickmarks scaled to the visible size of their frame
independently of its scroll. This coordinate system supports also CSS
scroll:overflow, transforms and the different positions.

Also add an auxiliary method to Range in order to provide a transform
friendly way to retrieve the absolute coordinates of the enclosing
bounding box without the adjustment operations that the existing
enclosingRect method does.

Tested by WebFrameTest WebKit unit test.

* dom/Range.cpp:
(WebCore::Range::transformFriendlyBoundingBox): add a transform-friendly equivalent of boundingBox.
(WebCore):
* dom/Range.h: move boundingBox to the group of non-transform-friendly methods.
(Range):

Source/WebKit/chromium:

Implement the funcionality of the find-in-page match rects API in WebFrame.
These methods keep a cache of the match rects in a special coordinate system
(find-in-page coordinates) and update them on size changes. They also allow
to recover the match closest to a given point, therefore enabling to move
to find matches when tapping on their corresponding tickmarks.

* WebKit.gyp: add FindInPageCoordinates.h / cpp.
* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::contentsSizeChanged): propagate didChangeContentsSize to WebFrameImpl.
* src/FindInPageCoordinates.cpp: Added.
(WebKit):
(WebKit::toNormalizedRect): auxiliary internal function.
(WebKit::findInPageRectFromAbsoluteRect): main coordinate conversion function.
(WebKit::findInPageRectFromRange): convenience conversion function for Ranges.
* src/FindInPageCoordinates.h: Added.
(WebCore):
(WebKit):
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::FindMatch::FindMatch): find matches cache constructor.
(WebKit):
(WebKit::WebFrameImpl::find): clear match cache when appropriate and zoom into results on the Android port.
(WebKit::WebFrameImpl::stopFinding): clear matches cache.
(WebKit::WebFrameImpl::scopeStringMatches): add new results to the matches cache.
(WebKit::WebFrameImpl::increaseMatchCount): update the matches cache version.
(WebKit::WebFrameImpl::resetMatchCount): update the matches cache version.
(WebKit::WebFrameImpl::findMatchMarkersVersion): new API providing the matches cache version.
(WebKit::WebFrameImpl::clearFindMatchesCache): internal utility method to reset the matches cache.
(WebKit::WebFrameImpl::isActiveMatchFrameValid): internal utility method to check if the local frame is still in the frame tree.
(WebKit::WebFrameImpl::updateFindMatchRects): internal utility method to update the match result rects if required.
(WebKit::WebFrameImpl::activeFindMatchRect): new API providing the active find match rect in find-in-page coordinates.
(WebKit::WebFrameImpl::findMatchRects): new API returning the valid match rects in find-in-page coordinates.
(WebKit::WebFrameImpl::appendFindMatchRects): internal utility method to concatenate the match results of multiple frames.
(WebKit::WebFrameImpl::selectNearestFindMatch): new API selecting the find match closer to a point in find-in-page coordinates.
(WebKit::WebFrameImpl::nearestFindMatch): internal utility method to find the nearest find match to a point in a frame.
(WebKit::WebFrameImpl::selectFindMatch): internal utility method to select a match in the cache.
(WebKit::WebFrameImpl::WebFrameImpl): initialization of new variables.
(WebKit::WebFrameImpl::didChangeContentsSize): invalidate the cached match rect coordinates on frame content size changes.
* src/WebFrameImpl.h:
(WebCore):
(WebFrameImpl):
(WebKit::WebFrameImpl::activeMatchFrame): remove unrequired const.
(WebKit::WebFrameImpl::activeMatch): expose the range of the active match to allow testing.
(FindMatch): cache structure for find matches.
* tests/WebFrameTest.cpp: new test case for find-in-page match rects.
* tests/data/find_in_page.html: Added. Test case layout.
* tests/data/find_in_page_frame.html: Added. Test case layout.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125379 268f45cc-cd09-0410-ab3c-d52691b4dbfc
table cell.cellIndex should return -1 if there is no parent table
https://bugs.webkit.org/show_bug.cgi?id=93738

Patch by Pravin D <pravind.2k4@gmail.com> on 2012-08-12
Reviewed by Eric Seidel.

Source/WebCore:

According to the HTML5 spec the cellIndex of a table cell(td/th) whose parent is not a table row
must be -1. Currently we are returning zero. This patch fixes this behavior.

Test: fast/table/cellIndex-of-cell-with-different-parents.html

* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::cellIndex):
  If the parent of the cell is not a table row, -1 is returned. Otherwise a value greater
  than or equal to zero is return.

* rendering/RenderTableCell.h:
(RenderTableCell):
 Removed dead code and made minor webkit style related fix.

LayoutTests:

* fast/table/cellIndex-of-cell-with-different-parents-expected.txt: Added.
* fast/table/cellIndex-of-cell-with-different-parents.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125380 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Tap highlight sometimes doesn't disappear
https://bugs.webkit.org/show_bug.cgi?id=93711

Patch by Arvid Nilsson <anilsson@rim.com> on 2012-08-12
Reviewed by Antonio Gomes.

The WebOverlayOverride implementation just changes properties of a
LayerCompositingThread directly, which means the changes will
immediately be overwritten on the next commit. Therefore, when the tap
highlight implementation adds a fade out animation, that animation will
instantly be removed again if a commit happens for any reason.

The reason is I totally botched the implementation of
WebOverlayOverride, it's not wrapping WebCore::LayerOverride at all,
instead for some reason it's manipulating the LayerCompositingThread
directly.

Fixed by actually mapping WebOverlayOverride calls to the corresponding
WebCore::LayerOverride method, and scheduling a compositing run to make
the change visible and kick off animations.

Reviewed internally by Sean Wang.

PR 188453

* Api/WebOverlay.cpp:
(BlackBerry::WebKit::WebOverlayPrivate::override):
* Api/WebOverlayOverride.cpp:
(BlackBerry::WebKit::WebOverlayOverride::WebOverlayOverride):
(BlackBerry::WebKit::WebOverlayOverride::~WebOverlayOverride):
(BlackBerry::WebKit::WebOverlayOverride::setPosition):
(BlackBerry::WebKit::WebOverlayOverride::setAnchorPoint):
(BlackBerry::WebKit::WebOverlayOverride::setSize):
(BlackBerry::WebKit::WebOverlayOverride::setTransform):
(BlackBerry::WebKit::WebOverlayOverride::setOpacity):
(BlackBerry::WebKit::WebOverlayOverride::addAnimation):
(BlackBerry::WebKit::WebOverlayOverride::removeAnimation):
* Api/WebOverlayOverride.h:
* Api/WebOverlay_p.h:
(WebOverlayPrivate):
(WebOverlayPrivateWebKitThread):
(WebOverlayPrivateCompositingThread):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125381 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Tap highlight flashes checkerboard after pinch zoom
https://bugs.webkit.org/show_bug.cgi?id=93601

Patch by Arvid Nilsson <anilsson@rim.com> on 2012-08-12
Reviewed by Antonio Gomes.

Since the tap highlight is usually rather small, we can reimplement
GraphicsLayerClient::contentsVisible() to always return true in order
to keep all AC layer tiles cached all the time.

PR 189895

* WebKitSupport/DefaultTapHighlight.cpp:
(BlackBerry::WebKit::DefaultTapHighlight::contentsVisible):
(WebKit):
* WebKitSupport/DefaultTapHighlight.h:
(DefaultTapHighlight):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125382 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening, skip new tests without expected results.

* platform/qt/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unnecessary null checks from pseudoStyleForElement and adjustRenderStyle
https://bugs.webkit.org/show_bug.cgi?id=93730

Reviewed by Tony Chang.

All the callers of both methods make sure to pass in a non-null parentStyle.

No change in behavior.

* css/StyleResolver.cpp:
* css/StyleResolver.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Fix Chromium's Android build.

* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::find): Needs parentheses for a function call.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Record metrics to measure the usage of WebKitBlobBuilder to eventually deprecate it
https://bugs.webkit.org/show_bug.cgi?id=90535

Reviewed by Eric Seidel.

No new tests as this has no functional changes.

* bindings/js/JSBlobCustom.cpp:
(WebCore::JSBlobConstructor::constructJSBlob):
* bindings/v8/custom/V8BlobCustom.cpp:
(WebCore::V8Blob::constructorCallback):
* fileapi/WebKitBlobBuilder.cpp:
(WebCore::WebKitBlobBuilder::getBlob):
* fileapi/WebKitBlobBuilder.h:
(WebKitBlobBuilder):

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