<http://webkit.org/b/119169> RetainPtr should support ARC for Objective-C objects.

While RetainPtr is not necessary under ARC, having it available makes it easier to transition
existing code from manual retain / release to ARC.

Under ARC, the object member of RetainPtr is treated as a strong reference by the compiler.
This means that merely assigning to the member variable is sufficient to retain the object,
and clearing the member variable is sufficient to release it. We still need to explicitly
CFRetain / CFRelease CoreFoundation types so the explicit calls to these functions are
moved in to helper functions and overloading is used to have the Objective-C object versions
of them be no-ops under ARC.

Reviewed by Anders Carlsson.

* wtf/RetainPtr.h:
(WTF::retain): Continue to always CFRetain / CFRelease CoreFoundation objects. Only CFRetain / CFRelease
Objective-C objects when using manual retain / release.
(WTF::release): Ditto.
(WTF::adoptNSReference): Adopting references will be handled automatically by the compiler
when possible under ARC by eliminating redundant retain / release pairs.
(WTF::RetainPtr::ImplicitConversionToBoolIsNotAllowed): A new method that exists only to be used by the
conversion to the unspecified bool type.
(WTF::RetainPtr::operator UnspecifiedBoolType): Switch to using a pointer to a member function as the
unspecified bool type to avoid warnings from the compiler when casting Objective-C object types under ARC.

(WTF::RetainPtr::RetainPtr): Switch to our retain / release helper functions.
(WTF::RetainPtr::~RetainPtr): Ditto.
(WTF::::RetainPtr): Ditto.
(WTF::::clear): Ditto.
(WTF::=): Ditto.
(WTF::adoptCF): Annotate the argument with CF_RELEASES_ARGUMENT on both the declaration and the definition.
(WTF::adoptNS): Ditto for NS_RELEASES_ARGUMENT.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153637 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Check WTF::Vector size with '0' inline capacity
https://bugs.webkit.org/show_bug.cgi?id=119397

Reviewed by Andreas Kling.

Putting in place the compile assertion that had been removed with r153514.

* wtf/SizeLimits.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153638 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add --rmdir option to git svn dcommit
https://bugs.webkit.org/show_bug.cgi?id=119398

Reviewed by Ryosuke Niwa.

Add this option tells git-svn to remove empty directories
from the svn tree so they do not leave over there.

* Scripts/webkitpy/common/checkout/scm/git.py:
(Git.push_local_commits_to_server):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153639 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Frame flattening: Change the logic on whether resize event needs to be dispatched.
https://bugs.webkit.org/show_bug.cgi?id=119394

Reviewed by Simon Fraser.

http://trac.webkit.org/changeset/149287 changed the logic so that resize events are
sent out from FrameView::setFrameRect() too. Checking whether frame flattening is
enabled is sufficient enough to ensure that no extra resize events are dispatched.

Source/WebCore:

Test: fast/frames/flattening/iframe-flattening-resize-event-count.html

* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::setFrameRect):
(WebCore::FrameView::frameFlatteningEnabled):
(WebCore::FrameView::supportsFrameFlattening):
(WebCore::FrameView::avoidScrollbarCreation):
(WebCore::FrameView::calculateScrollbarModesForLayout):
(WebCore::FrameView::layout):
(WebCore::FrameView::isInChildFrameWithFrameFlattening):
* page/FrameView.h:
* rendering/RenderFrameBase.cpp:
(WebCore::RenderFrameBase::layoutWithFlattening):

LayoutTests:

* fast/frames/flattening/iframe-flattening-resize-event-count-expected.txt: Added.
* fast/frames/flattening/iframe-flattening-resize-event-count.html: Added.
* fast/frames/flattening/resources/iframe-to-resize.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153640 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Removing an empty style sheet shouldn't trigger style recalc.
<http://webkit.org/b/119248>
<rdar://problem/14629045>

Reviewed by Antti Koivisto.

Teach DocumentStyleSheetCollection to filter out empty style sheets when deciding whether
or not to trigger a style recalc. We can then be clever when an empty style sheet is removed
from the document, and avoid causing extra work.

Some pages use this pattern:

    (1) Create a <style> element.
    (2) Add it to the document's <head> element.
    (3) Insert some CSS as a text child of the <style> element.

Since the <style> element is already inside the document at (3), we had to treat this as an
old style sheet being removed, even though it was just an empty sheet of nothing.

With this patch, Document gains enough smarts to know that removing/adding an empty sheet
won't affect layout/rendering in any meaningful way, thus a style recalc can be avoided.

* dom/Document.h:
* dom/Document.cpp:
(WebCore::Document::styleResolverChanged):

    Add a DeferRecalcStyleIfNeeded mode to styleResolverChanged().

* css/CSSStyleSheet.h:
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::clearOwnerNode):

    Use DeferRecalcStyleIfNeeded when saying bye from a CSSStyleSheet and let Document decide
    if removing the sheet should trigger style recalc instead of always assuming it should.

* dom/DocumentStyleSheetCollection.cpp:
(WebCore::filterEnabledNonemptyCSSStyleSheets):
(WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):

    Exclude empty sheets from the activeAuthorStyleSheets() collection. They are still
    visible through CSSOM's document.styleSheets.

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