<rdar://problem/11855229> When in paginated mode, the layout timer fires continually
https://bugs.webkit.org/show_bug.cgi?id=91038

Reviewed by Simon Fraser.

* page/Page.cpp:
(WebCore::Page::pageCount): Changed to only trigger layout if needed.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125314 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash on accessing a removed layout root in FrameView::scheduleRelayout.
https://bugs.webkit.org/show_bug.cgi?id=91368

Reviewed by Levi Weintraub.

We were calling setNeedsLayoutAndPrefWidthsRecalc() in RenderBlock::collapseAnonymousBoxChild
even when documentBeingDestroyed() was true. This ends up accessing stale layout root and bypasses
mitigation added in r109406. There is no need to waste time merging up anonymous blocks in
RenderBlock::removeChild when documentBeingDestroyed() is true.

No new tests. The test is time sensitive, requires a bunch of reloads, and only reproduces on chromium linux.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::collapseAnonymousBoxChild):
(WebCore::RenderBlock::removeChild):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
NRWT crashes when DRT with --encode-binary crashes just before it dumps pixels
https://bugs.webkit.org/show_bug.cgi?id=93728

Reviewed by Dirk Pranke.

* Scripts/webkitpy/layout_tests/port/driver.py:
(ContentBlock.decode_content): Check self.content is not None before calling base64.b64decode().


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125316 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed; fix an insanely silly typo.

* resources/results-template.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125317 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use the new AVPlayerItemVideoOutput API in MediaPlayerPrivateAVFoundation.
https://bugs.webkit.org/show_bug.cgi?id=93591

Reviewed by Eric Carlson.

Support the new AVPlayerItemVideoOutput API from Mountain Lion, which has much increased performance over
AVAssetImageGenerator.

No new tests; Performance change only, no net change in functionality.

AVPlayerItemVideoOutput requires an attached CALayer for rendering to occur.  Make the rendering modes non-exclusive,
so layer-rendering and context-rendering can exist simultaneously:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: Make the MediaRenderingMode enum
    a bitfield.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::currentRenderingModes): Renamed from currentRenderingMode().
(WebCore::MediaPlayerPrivateAVFoundation::setUpVideoRendering): Check for the presence of the MediaRenderingToLayer bit.
(WebCore::MediaPlayerPrivateAVFoundation::prepareForRendering): Ditto.
(WebCore::MediaPlayerPrivateAVFoundation::updateStates): Ditto.

Pull out existing the AVAssetImageGenerator into its own functions:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
(WebCore::MediaPlayerPrivateAVFoundationObjC::destroyImageGenerator):
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):

Add new AVPlayerItemVideoOutput equivalent functions:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
(WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoOutput):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createPixelBuffer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):

Switch between the AVAssetImageGenerator and AVPlayerItemVideoOutput functions from
within the original functions:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createContextVideoRenderer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::destroyContextVideoRenderer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::hasContextRenderer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::paint):

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect): Call the
    AVAssetImageGenerator creation function directly.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash exiting from HTML5 FS mode to normal mode via ESC key
https://bugs.webkit.org/show_bug.cgi?id=93663

Reviewed by Eric Carlson.

Crash is due to a refcount underrun with _watchdogTimer due to adopting an autoreleased NSTimer.
Use the non-autoreleased NSTimer creation method and manually add to the main NSRunLoop.

* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController cancelOperation:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add support for String initialization from literal to WTFString
https://bugs.webkit.org/show_bug.cgi?id=93426

Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-08-10
Reviewed by Anders Carlsson.

Source/WTF: 

This patch adds two constructor to WTF::String in order to support fast initialization from literal:
-String(ASCIILiteral): Constructor similar to String(const char*) while being faster. This constructor
 does not incur any overhead over String(const char*).
-String(char[], ConstructFromLiteralTag): Template constructor that encode explicitely the size of the
 string.

String(ASCIILiteral) is expected to be used in most cases to avoid regressions. This constructor was
added because of what we have learned from r124922: inlining the string length in the code causes a code bloat
that is not always welcome.

Regarding performance of string initialization, the constructors performance are (6 characters string):
-String(ASCIILiteral): 16% faster.
-String(char[], ConstructFromLiteralTag): 33% faster (the delta increases with the string length).

In addition, no memory is allocated for the characters.

* wtf/text/StringImpl.cpp:
* wtf/text/StringImpl.h:
(WTF::StringImpl::createFromLiteral): Extend StringImpl::createFromLiteral to have a version
with strlen() which avoids loading one extra argument.
* wtf/text/WTFString.cpp:
(WTF::String::String):
* wtf/text/WTFString.h:
(WTF::String::String):
(ASCIILiteral): This class is aimed at making the construction of WTFString from a literal very easy.
By using the explicit constructor ASCIILiteral(char *), one can expect the implicit conversion to String
when needed.
(WTF::ASCIILiteral::ASCIILiteral):
(WTF::ASCIILiteral::operator const char*):

Tools: 

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/StringImpl.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/WTFString.cpp: Copied from Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp.
(TestWebKitAPI):
(TestWebKitAPI::TEST):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125320 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Broken implementation of AtkText and AtkEditableText for password fields
https://bugs.webkit.org/show_bug.cgi?id=93621

Reviewed by Chris Fleizach.

Source/WebCore:

Fix broken implementation of AtkText and AtkEditableText
interfaces in the GTK port for password input fields.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::stringValue): Call the new
function passwordFieldValue() for password input fields.
(WebCore::AccessibilityRenderObject::text): Ditto.
(WebCore::AccessibilityRenderObject::textLength): Return the
actual length of the password in the field for GTK, return -1
otherwise (not to break current behavior in other platforms).
(WebCore::AccessibilityRenderObject::doAXStringForRange): Don't
early return for password fields in GTK (will rely on text()).
(WebCore::AccessibilityRenderObject::passwordFieldValue): New, it
returns the text being actually rendered for a password input
field (normally a masked string) in GTK. It returns String() in
the rest of platforms, to ensure we don't break anything there.
(WebCore):
* accessibility/AccessibilityRenderObject.h:
(AccessibilityRenderObject):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::passwordFieldValue): Default
implementation of this new method, returning an empty string.
(AccessibilityObject):

Ensure the 'text-insert' and 'text-remove' signals for the AtkText
interface are properly emitted for password input fields.

* accessibility/gtk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::nodeTextChangePlatformNotification): Make
sure we never emit the password value for an input field in plain
text when inserting or removing text. Emit the masked text instead.

Source/WebKit/gtk:

Update unit test to ensure that password input fields behave
as expected when inserting and removing characters in them.

* tests/testatk.c:
(testWebkitAtkTextChangedNotifications): Updated unit test to
cover the special case of password input fields.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Enable relro link option for JSC executable
https://bugs.webkit.org/show_bug.cgi?id=93726

Reviewed by Yong Li.

Enable relro link option for JSC executable.

* Source/cmake/OptionsBlackBerry.cmake:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125322 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r125310.
http://trac.webkit.org/changeset/125310
https://bugs.webkit.org/show_bug.cgi?id=93739

The DEPS roll broke Android. One does not simply break
Android. (Requested by fmalita_ on #webkit).

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

* DEPS:

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