[AX] Improve AccessibilityTableCell columnHeaders and rowHeaders functions.
https://bugs.webkit.org/show_bug.cgi?id=136818

Patch by Andrzej Badowski <a.badowski@samsung.com> on 2014-10-14
Reviewed by Chris Fleizach.

Source/WebCore:

Take into account that <th> elements can be both the column headers and row headers
improved the operation of two functions: columnHeaders and rowHeaders.

Test: accessibility/table-headers.html

* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::isColumnHeaderCell):
A new function that helps the main goal.
(WebCore::AccessibilityTableCell::isRowHeaderCell):
A new function that helps the main goal.
(WebCore::AccessibilityTableCell::columnHeaders):
Use isColumnHeaderCell instead of isTableHeaderCell.
(WebCore::AccessibilityTableCell::rowHeaders):
Use isRowHeaderCell also includes <th> row header element next to the scope attribute.
* accessibility/AccessibilityTableCell.h:
Adds new functions to the header file.

LayoutTests:

* accessibility/table-headers-expected.txt: Added.
* accessibility/table-headers.html: Added.
* platform/mac/accessibility/table-attributes-expected.txt:
* platform/mac/accessibility/table-cells-expected.txt:
* platform/mac/accessibility/table-sections-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174675 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use is<>() / downcast<>() for RenderImage
https://bugs.webkit.org/show_bug.cgi?id=137683

Reviewed by Mihnea Ovidenie.

Use is<>() / downcast<>() for RenderImage.

Source/WebCore:

No new tests, no behavior change.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::alternativeText):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::addImageMapChildren):
(WebCore::AccessibilityRenderObject::remoteSVGRootElement):
* bindings/objc/DOM.mm:
(-[DOMElement image]):
(-[DOMElement _imageTIFFRepresentation]):
* editing/TextIterator.cpp:
(WebCore::TextIterator::handleReplacedElement):
* editing/cocoa/HTMLConverter.mm:
(fileWrapperForElement):
* editing/gtk/EditorGtk.cpp:
(WebCore::getImageForElement):
* editing/ios/EditorIOS.mm:
(WebCore::getImage):
* editing/mac/EditorMac.mm:
(WebCore::getImage):
* html/HTMLAnchorElement.cpp:
(WebCore::appendServerMapMousePosition):
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::setFocus):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
(WebCore::HTMLImageElement::parseAttribute):
(WebCore::HTMLImageElement::didAttachRenderers):
(WebCore::HTMLImageElement::createImageControls):
(WebCore::HTMLImageElement::destroyImageControls):
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::didAttachRenderers):
(WebCore::HTMLVideoElement::parseAttribute):
* html/ImageInputType.cpp:
(WebCore::ImageInputType::altAttributeChanged):
(WebCore::ImageInputType::attach):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::size):
* html/shadow/mac/ImageControlsRootElementMac.cpp:
(WebCore::RenderImageControls::updateLogicalWidth):
(WebCore::RenderImageControls::computeLogicalHeight):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::renderImageResource):
* page/ContextMenuController.cpp:
(WebCore::imageFromImageElementNode):
* page/DragController.cpp:
(WebCore::getCachedImage):
(WebCore::getImage):
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::writeImage):
(WebCore::getCachedImage):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::image):
* rendering/RenderImage.h:
* rendering/RenderImageResource.cpp:
(WebCore::RenderImageResource::getImageSize):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::isDirectlyCompositedImage):
(WebCore::RenderLayerBacking::updateImageContents):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::createShapeForImage):

Source/WebKit/mac:

* Misc/WebNSPasteboardExtras.mm:
(imageFromElement):
(-[NSPasteboard _web_declareAndWriteDragImageForElement:URL:title:archive:source:]):

Source/WebKit2:

* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::cachedImage):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::performActionOnElement):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Changes in the stretchy attribute do not update rendering
https://bugs.webkit.org/show_bug.cgi?id=136883

Reviewed by Darin Adler.

Source/WebCore:

Test: mathml/presentation/mo-stretch-update.html

We need to relayout when a change in the stretchy attribute
happens.

* mathml/MathMLTextElement.cpp:
(WebCore::MathMLTextElement::parseAttribute): Parse the
modifications of the stretchy attribute.
* mathml/MathMLTextElement.h:
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::setOperatorFlagAndScheduleLayoutIfNeeded):
Add function that receives the value instead of looking for it and
checks if the change should schedule a layout.
(WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute):
(WebCore::RenderMathMLOperator::setOperatorFlagFromAttributeValue):
Add function that receives the value instead of looking for it.
* rendering/mathml/RenderMathMLOperator.h:

LayoutTests:

The test updates the stretchy value in a timeout.

* mathml/presentation/mo-stretch-update-expected.html: Added.
* mathml/presentation/mo-stretch-update.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Multiple refactors in RenderMathMLOperator
https://bugs.webkit.org/show_bug.cgi?id=137611

Reviewed by Darin Adler.

The changes include:
- Rename m_operator to m_textContent.
- Make most of the functions private, we needed to create some
public member functions to be able to make the some funtions private
and move trailingSpaceError to RenderMathMLOperator.
- Fix incorrect capitalization of setOperatorProperties function.
- Make all data members private and move them to the end of the
class defition.

No new tests as no change in functionality.

* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::RenderMathMLOperator):
(WebCore::RenderMathMLOperator::setOperatorProperties): Renamed,
incorrect capitalization
(WebCore::RenderMathMLOperator::stretchTo):
(WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
(WebCore::RenderMathMLOperator::rebuildTokenContent):
(WebCore::RenderMathMLOperator::updateFromElement):
(WebCore::RenderMathMLOperator::updateOperatorProperties):
(WebCore::RenderMathMLOperator::shouldAllowStretching):
(WebCore::RenderMathMLOperator::updateStyle):
(WebCore::RenderMathMLOperator::trailingSpaceError):
(WebCore::RenderMathMLOperator::SetOperatorProperties): Deleted.
(WebCore::RenderMathMLOperator::advanceForGlyph): Deleted.
(WebCore::RenderMathMLOperator::updateTokenContent): Deleted.
(WebCore::RenderMathMLOperator::getGlyphAssemblyFallBack): Deleted.
* rendering/mathml/RenderMathMLOperator.h:
(WebCore::RenderMathMLOperator::setLeadingSpace): Added.
(WebCore::RenderMathMLOperator::setTrailingSpace):  Added.
(WebCore::RenderMathMLOperator::textContent): Added.
(WebCore::RenderMathMLOperator::isInvisibleOperator):
* rendering/mathml/RenderMathMLRadicalOperator.cpp:
(WebCore::RenderMathMLRadicalOperator::setOperatorProperties):
Renamed, incorrect capitalization
(WebCore::RenderMathMLRadicalOperator::SetOperatorProperties): Deleted.
(WebCore::RenderMathMLRadicalOperator::trailingSpaceError): Deleted.
* rendering/mathml/RenderMathMLRadicalOperator.h:

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