[BlackBerry] ASSERT(!m_tileMatrixNeedsUpdate) in BackingStorePrivate::render()
https://bugs.webkit.org/show_bug.cgi?id=118062

Patch by Jacky Jiang <zhajiang@blackberry.com> on 2013-06-26.
Reviewed by Rob Buis.
Internally reviewed by Jakob Petsovits.

JIRA426949
requestLayoutIfNeeded() can cause zoomAboutPoint() when the layout
is finished and make the tile matrix stale. We need requestLayoutIfNeeded()
before we updateTileMatrixIfNeeded() so that we can fix the ASSERT and
also pass the valid TileIndexList to render().

* Api/BackingStore.cpp:
(BlackBerry::WebKit::BackingStorePrivate::resumeScreenUpdates):
(BlackBerry::WebKit::BackingStorePrivate::render):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151995 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Adopt is/toHTMLAreaElement for code cleanup
https://bugs.webkit.org/show_bug.cgi?id=117980

Reviewed by Antonio Gomes.

To enhance readibility, this patch adopts is/toHTMLAreaElement.
This also helps out to reduce duplicated use of static_cast.

Source/WebCore:

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::focusedUIElementForPage):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::getDocumentLinks):
(WebCore::AccessibilityRenderObject::accessibilityHitTest):
(WebCore::AccessibilityRenderObject::addImageMapChildren):
* html/HTMLAreaElement.h:
(WebCore::isHTMLAreaElement):
(WebCore::toHTMLAreaElement):
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::mapMouseEvent):
* page/FocusController.cpp:
(WebCore::FocusController::advanceFocusDirectionally):
* page/SpatialNavigation.cpp:
(WebCore::FocusCandidate::FocusCandidate):
(WebCore::areElementsOnSameLine):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::absoluteLinkURL):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing):

Source/WebKit/blackberry:

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::webContext):
* WebKitSupport/TouchEventHandler.cpp:
(BlackBerry::WebKit::elementForTapHighlight):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Flex boxes (both old and new) don't handle max-height images correctly.
https://bugs.webkit.org/show_bug.cgi?id=118000

Reviewed by Beth Dakin.

Source/WebCore: 

Tests: css3/flexbox/image-percent-max-height.html
       fast/flexbox/image-percent-max-height.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::dirtyForLayoutFromPercentageHeightDescendants):
(WebCore::RenderBlock::layoutBlockChildren):
Pull the percentage height descendant code that dirties those descendants
out of layoutBlockChildren and into a protected helper function,
dirtyForLayoutFromPercentageHeightDescendants, that can be called from the 
flex box code.
        
Also patch dirtyForLayoutFromPercentageHeightDescendants so that it will dirty
preferred logical widths when a child has an aspect ratio, since we know that
percentage height changes will potentially affect the preferred widths of the image and
its ancestor blocks.

* rendering/RenderBlock.h:
Declaration of the new dirtyForLayoutFromPercentageHeightDescendants function.

* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
Make the old flex box code call dirtyForLayoutFromPercentageHeightDescendants so
that everything is dirtied properly.

(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
(WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
Remove the isReplaced()/percentage height/width dirtying now that the old flexible
box is using the same dirtying mechanism as RenderBlock.

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock):
Patch the new flexible box code to use the dirtying mechanism that RenderBlock
uses for percentage heights/widths on replaced descendants.

* rendering/RenderObject.h:
(WebCore::RenderObject::hasAspectRatio):
Pulled the static helper function from RenderReplaced into a full-blown method
on RenderObject, so that dirtyForLayoutFromPercentageHeightDescendants can call
it to check if an object has an aspect ratio.

* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox):
(WebCore::RenderReplaced::computeIntrinsicRatioInformation):
Patch the call sites of the static helper function to use hasAspectRatio instead
and get rid of the static in the cpp file.

LayoutTests: 

* css3/flexbox/image-percent-max-height-expected.html: Added.
* css3/flexbox/image-percent-max-height.html: Added.
* css3/flexbox/resources/hero.png: Added.
* fast/flexbox/image-percent-max-height-expected.html: Added.
* fast/flexbox/image-percent-max-height.html: Added.
* fast/flexbox/resources/hero.png: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151997 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Set Attr.ownerDocument in Element#setAttributeNode()
https://bugs.webkit.org/show_bug.cgi?id=118031

Reviewed by Andreas Kling.

Source/WebCore: 

Merge https://chromium.googlesource.com/chromium/blink/+/fa739fe5369f55bbdcb3fa123cb64df36b8ae414.

Adopt Attr node as needed.

Test: fast/dom/Attr/set-attribute-node-from-iframe.html

* dom/Element.cpp:
(WebCore::Element::setAttributeNode):

LayoutTests: 

Add a regression test.

* fast/dom/Attr/set-attribute-node-from-iframe-expected.txt: Added.
* fast/dom/Attr/set-attribute-node-from-iframe.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151998 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unneeded static_casts from SelectorChecker
https://bugs.webkit.org/show_bug.cgi?id=118018

Reviewed by Christophe Dumez.

Merge https://chromium.googlesource.com/chromium/blink/+/adc5b8bec2d8c6a857b3c930ca7484f76cad1367

SelectorChecker::checkOne casts to StyledElement just to call classNames, but
this method is on Element so there's no reason for this. The cast here also
looks pretty suspect. The method also casts to HTMLFrameElementBase to call
containsFullScreenElement which is also on Element so the cast can be removed.

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderBox::hasRenderOverflow should return bool instead of RenderOverflow*
https://bugs.webkit.org/show_bug.cgi?id=118041

Reviewed by Christophe Dumez.

Merge https://chromium.googlesource.com/chromium/blink/+/1683b58c855b745463acbf18086e32279db5000f.

* rendering/RenderBox.h:
(WebCore::RenderBox::hasRenderOverflow):
(WebCore::RenderBox::hasHorizontalLayoutOverflow):
(WebCore::RenderBox::hasVerticalLayoutOverflow):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152002 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unneccesary cast to Node* in MediaControlTextTrackContainerElement::updateDisplay
https://bugs.webkit.org/show_bug.cgi?id=118020

Reviewed by Christophe Dumez.

Merge https://chromium.googlesource.com/chromium/blink/+/2de89f61bb316f5e166b45ce71bb2b293dbf575d

TextTrackCue is a Node, there's no reason to static_cast from it to Node*.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Prepare CaptionUserPreferencesMac for use on Windows port.
https://bugs.webkit.org/show_bug.cgi?id=118069

Reviewed by Eric Carlson.

* WebCore.vcxproj/WebCore.vcxproj: Add new files.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* WebCore.xcodeproj/project.pbxproj: Update for new file name.
* page/CaptionUserPreferencesMac.h: Removed.
* page/CaptionUserPreferencesMac.mm: Removed.
* page/CaptionUserPreferencesMediaAF.cpp: Copied from page/CaptionUserPreferencesMac.mm.
* page/CaptionUserPreferencesMediaAF.h: Copied from page/CaptionUserPreferencesMac.h.
* page/PageGroup.cpp:
(WebCore::PageGroup::captionPreferences): Updated to new class name.


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