Add Deque::removeLast
https://bugs.webkit.org/show_bug.cgi?id=118466

Source/WTF: 

Reviewed by Andreas Kling.
        
Deque can remove both the first and the last element efficiently.
        
Test: TestWebKitAPI/Tests/WTF/Deque.cpp

* wtf/Deque.h:
(WTF::::takeLast):
(WTF::::removeLast):

Tools: 

Reviewed by Andreas Kling.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/Deque.cpp: Added.
(TestWebKitAPI::TEST):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152449 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Coordinated Graphics] Rename variables in UpdateAtlas
https://bugs.webkit.org/show_bug.cgi?id=118403

Patch by Jae Hyun Park <jae.park@company100.net> on 2013-07-08
Reviewed by Noam Rosenthal.

As of r149292, non-composited contents layer was removed from
CoordinatedGraphics. So, the variables should be renamed for
clarification.

* platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
(WebCore::CompositingCoordinator::releaseInactiveAtlasesTimerFired):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152450 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Introduce DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER() macro
https://bugs.webkit.org/show_bug.cgi?id=118408

Reviewed by Philip Rogers.

Split DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER() macro into separate
DECLARE and DEFINE macros to reduce the number of header includes in
SVG.

No new tests, no behavior change.

* dom/EventTarget.h:
* svg/SVGElementInstance.cpp:
(WebCore::SVGElementInstance::create):
(WebCore::SVGElementInstance::toNode):
(WebCore::SVGElementInstance::ownerDocument):
* svg/SVGElementInstance.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152451 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Block Zoom does not zoom in on narrow paragraphs properly
https://bugs.webkit.org/show_bug.cgi?id=118472

Patch by Jacky Jiang <zhajiang@blackberry.com> on 2013-07-08.
Reviewed by Rob Buis.
Internally reviewed Arvid Nilsson and Genevieve Mak.

JIRA 114653
For the narrow paragraphs on www.nytimes.com, the first best node for
block zoom under the point is deprecated due to the limits of maximum
block zoom scale(3) and default maximum WebPage zoom scale(4) and instead
it picks up an ancestor node which is wider so that it looks like doesn't
zoom in properly.
To fix that, enlarge the default maximum WebPage zoom scale slightly
and use maximumScale() instead of maxBlockZoomScale() so that we can
accept more nodes. And also we'll still clamp the new scale by
maxBlockZoomScale() when we block zoom the WebPage, in which way those
nodes can be showed in the center of the viewport and surrounded by a
few other nodes within the viewport which shows better user experience.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::maximumScale):
(BlackBerry::WebKit::WebPagePrivate::adjustedBlockZoomNodeForZoomAndExpandingRatioLimits):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152452 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r125294): A style rule with more than 8192 selectors can cause style corruption.
<http://webkit.org/b/118369>
<rdar://problem/14291428>

Reviewed by Antti Koivisto.

Source/WebCore:

Add a semi-hard cap of 8192 selectors per CSS rule. Rules with longer selector lists will be split into
multiple rules (with 8192 selectors per rule.) The style properties are shared behind the scenes
so it's all pretty efficient.

This does generate a different CSSOM for gigantic selector lists, I've added a test to document this.
Note that setting CSSStyleRule.selectorText with over 8192 selectors will now fail, the splitting into
multiple rules only happens when parsing full style sheets.

Test: fast/css/rule-selector-overflow.html

* css/CSSSelectorList.cpp:
(WebCore::CSSSelectorList::selectorCount):

    Add a helper to count the number of selectors in a list (not the number of raw selector components.)

* css/RuleSet.h:
* css/CSSStyleRule.cpp:
(WebCore::CSSStyleRule::setSelectorText):

    Add RuleData::maximumSelectorCount constant and cap CSSStyleRule.selectorText to that many selectors.

* css/CSSSelectorList.h:
(WebCore::CSSSelectorList::adoptSelectorArray):
* css/StyleRule.cpp:
(WebCore::StyleRule::create):
(WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorCount):
* css/StyleRule.h:
(WebCore::StyleRule::parserAdoptSelectorArray):
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parserAppendRule):

    The meat of this change. Split rules with >8K selectors into multiple rules with 8K selectors in each.

* css/StyleRule.h:
(WebCore::toStyleRule):

    Added a toStyleRule() helper for good measure.

LayoutTests:

Added a test to document the new cap of 8192 selectors per CSS rule.

* fast/css/rule-selector-overflow-expected.txt: Added.
* fast/css/rule-selector-overflow.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152453 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Autoconf] Define WTF_USE_OPENGL when OpenGL was found
https://bugs.webkit.org/show_bug.cgi?id=118341

Reviewed by Gustavo Noronha Silva.

After r152275, WTF_USE_OPENGL is only defined if the accelerated compositing is enabled.
This breaks the build if disabling the accelerated compositing feature as the OpenGL-specific
code is not compiled anymore even if it's still required.

To avoid that, WTF_USE_OPENGL should be defined if OpenGL was found. The accelerated compositing
feature also relies on this condition, exiting the configuration process with an error otherwise.

* Source/autotools/SetupAutoconfHeader.m4:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152454 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Acceleration description isn't displayed in configured options.
https://bugs.webkit.org/show_bug.cgi?id=118441

Patch by ChangSeok Oh <changseok.oh@collabora.com> on 2013-07-08
Reviewed by Gustavo Noronha Silva.

The acceleration_backend_description has been changed to acceleration_description from r152275.

* Source/autotools/PrintBuildConfiguration.m4:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r152416.
http://trac.webkit.org/changeset/152416
https://bugs.webkit.org/show_bug.cgi?id=118476

Wrong fix for the bug (Requested by ap on #webkit).

* platform/text/TextEncodingRegistry.cpp:
(WebCore::newTextCodec):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152456 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix TextTrackCue::cueIndex() to handle the null case of TextTrack::cues(() properly
https://bugs.webkit.org/show_bug.cgi?id=117815
<rdar://problem/14211041>

Patch by Ruth Fong <ruth_fong@apple.com> on 2013-07-08
Reviewed by Eric Carlson.

Merge https://src.chromium.org/viewvc/blink?revision=153206&view=revision

No new tests, only behavior change is preventing a crash in the release build.
cueIndex() is only used for sorting cues, so returning an invalidCueIndex in the case
where track()->cues() is null makes sense and won't modify behavior.

* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::cueIndex):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Fix make distcheck.

Source/JavaScriptCore:

* GNUmakefile.list.am: Add missing header files.

Source/WebCore:

* GNUmakefile.list.am: Add missing header files.

Source/WTF:

* GNUmakefile.list.am: Add missing header files.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152460 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Skip fast/repaint/fixed-right-in-page-scale.html on Lion.
https://bugs.webkit.org/show_bug.cgi?id=118479

Unreviewed: test marked as crashing.

* platform/mac-lion/TestExpectations:
Skip fast/repaint/fixed-right-in-page-scale.html.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152461 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mark fast/text/international/synthesized-italic-vertical-latin.html as failing on Lion.
https://bugs.webkit.org/show_bug.cgi?id=118480

Unreviewed TestExpectation change.

* platform/mac-lion/TestExpectations:
Mark fast/text/international/synthesized-italic-vertical-latin.html as Failure.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152462 268f45cc-cd09-0410-ab3c-d52691b4dbfc
fast/repaint/fixed-right-in-page-scale.html also crashing on Mountain Lion.
https://bugs.webkit.org/show_bug.cgi?id=118479

Moved expectation to higher-level mac and marked as [ Pass Crash ].
* platform/mac-lion/TestExpectations:
* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152463 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: iOS: SVG paths are not offset by the parent bounding box
https://bugs.webkit.org/show_bug.cgi?id=118433

The path for SVG shapes is in terms of its parent's view space. We need to offset
the path by that amount so that it's in the right location.

Reviewed by Tim Horton.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::elementPath):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152464 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unused variables in FocusCandidate.
https://bugs.webkit.org/show_bug.cgi?id=118449

Patch by Changhun Kang <temoochin@company100.net> on 2013-07-06
Reviewed by Antonio Gomes.

The variables for parent in FocusCandidate are not used anymore.

No new tests. No change in behavior.

* page/SpatialNavigation.cpp:
(WebCore::FocusCandidate::FocusCandidate):
* page/SpatialNavigation.h:
(WebCore::FocusCandidate::FocusCandidate):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
NamedFlowCollection getters should return undefined when there's no NamedFlow
https://bugs.webkit.org/show_bug.cgi?id=118463

Patch by Radu Stavila <stavila@adobe.com> on 2013-07-08
Reviewed by Christophe Dumez.

Source/WebCore:

Added new TreatReturnedNullObjectAs attribute for generated methods and set it to Undefined
for the item and namedItem methods of DOMNamedFlowCollection.

Test: fast/regions/webkit-named-flow-collection-undefined.html

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementationFunctionCall):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/CPP/WebDOMTestObj.cpp:
(WebDOMTestObj::treatReturnedNullObjectAsUndefined):
* bindings/scripts/test/CPP/WebDOMTestObj.h:
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_treat_returned_null_object_as_undefined):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionTreatReturnedNullObjectAsUndefined):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj treatReturnedNullObjectAsUndefined]):
* bindings/scripts/test/TestObj.idl:
* dom/DOMNamedFlowCollection.idl:

LayoutTests:

Added test that validates that NamedFlowCollection getters return undefined
when no named flows exist.

* fast/regions/webkit-named-flow-collection-undefined-expected.txt: Added.
* fast/regions/webkit-named-flow-collection-undefined.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        [Mac] Multiple compositing/patterns test fail
        https://bugs.webkit.org/show_bug.cgi?id=118490

        * platform/mac/TestExpectations: The failures appear to be WK2 only in my testing,
        so moved the expectations to mac-wk2.

        * platform/mac-wk2/TestExpectations: Updated bug numbers.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152470 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DeleteSelectionCommand does not handle correctly deletion with two consecutive BR element.
https://bugs.webkit.org/show_bug.cgi?id=118457
<rdar://problem/14160912>

Reviewed by Simon Fraser.

Source/WebCore: 

In DeleteSelectionCommand::handleSpecialCareBRDelete we did not
handle correctly the case where we had <br><br> in the markup and
nothing was being deleted. We should consider this like
the case where the <br> is on the line by itself and remove it.

Test: editing/deleting/delete-image-followed-by-two-br.html

* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::handleSpecialCaseBRDelete):

LayoutTests: 

* editing/deleting/delete-image-followed-by-two-br-expected.txt: Added.
* editing/deleting/delete-image-followed-by-two-br.html: Added.
* platform/mac/editing/deleting/delete-br-002-expected.txt: Rebased.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152478 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Grid Layout] Rename grid-{rows|columns} to grid-definition-{rows|columns}
https://bugs.webkit.org/show_bug.cgi?id=103336

Reviewed by Tony Chang.

Source/WebCore:

Rename -webkit-grid-{rows|columns} to -webkit-grid-definition-{rows|columns}.
The latest version of the spec has renamed these properties.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Handle the new names.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue): Ditto.
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty): Ditto.
* css/CSSPropertyNames.in: Add support for the new names.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty): Handle the new names.

LayoutTests:

Update tests to reflect the rename of -webkit-grid-{rows|columns} to
-webkit-grid-definition-{rows|columns}.

* fast/css-grid-layout: Mass search and replace for the new name.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152479 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add WebInspectorUI to WebKit.xcworkspace
https://bugs.webkit.org/show_bug.cgi?id=118491

Reviewed by Sam Weinig.

* WebKit.xcworkspace/contents.xcworkspacedata:

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