Introduce Node::shadowHost()
https://bugs.webkit.org/show_bug.cgi?id=91814

Reviewed by Hajime Morita.

Introduce Node::shadowHost(), which return the host element, or 0.
Node::shadowAncestorNode() is used to obtain a shadow host. However it
is confusing because it returns 'this' if this is not in a shadow tree.

Replaces one callsite of shadowAncestorNode() with shadowHost().

No behavior change.

* dom/Node.cpp:
(WebCore::Node::shadowHost): Added.
* dom/Node.h:
(Node): Declare shadowHost(), and add a comment to shadowAncestorNode().
* html/shadow/CalendarPickerElement.cpp:
(WebCore::CalendarPickerElement::hostInput):
Replace shadowAncestorNode() with shaodwHost().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123180 268f45cc-cd09-0410-ab3c-d52691b4dbfc
The ATSUI-based complex text code is unused
https://bugs.webkit.org/show_bug.cgi?id=91816

Reviewed by Sam Weinig.

../WebCore: 

* WebCore.gypi: Removed references to the files deleted in this change.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/graphics/FontCache.h:
(FontCache): Replaced USE(CORE_TEXT) with PLATFORM(MAC) || PLATFORM(CHROMIUM) && OS(DARWIN).
* platform/graphics/SimpleFontData.h:
(SimpleFontData): Removed USE(ATSUI)-only code, replaced USE(CORE_TEXT) with
(PLATFORM(CHROMIUM) && OS(DARWIN)).
* platform/graphics/mac/ComplexTextController.cpp: Removed USE(ATSUI)-only code. Moved
collectComplexTextRunsForCharacters() and the ComplexTextRun constructor out of this file.
* platform/graphics/mac/ComplexTextController.h: Removed USE(ATSUI)-only code and removed
#if USE(CORE_TEXT) because anyone including this header is using Core Text.
* platform/graphics/mac/ComplexTextControllerATSUI.cpp: Removed.
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Moved from
ComplexTextController.cpp into this file and merged with createTextRunFromFontDataCoreText().
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Moved from
ComplexTextController.cpp into this file and merged with
collectComplexTextRunsForCharactersCoreText().
* platform/graphics/mac/SimpleFontDataATSUI.mm: Removed.
* platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore::SimpleFontData::platformInit): Remove USE(ATSUI)-only code.
(WebCore::SimpleFontData::platformDestroy): Ditto.
* platform/text/mac/ShapeArabic.c: Removed.
* platform/text/mac/ShapeArabic.h: Removed.

../WTF: 

Removed definitions of WTF_USE_ATSUI and WTF_USE_CORE_TEXT.

* wtf/Platform.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123181 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: Need AccessibilityObjects for nodes without renderers in canvas subtree
https://bugs.webkit.org/show_bug.cgi?id=87899

Reviewed by Chris Fleizach.

Source/WebCore:

Refactors AccessibilityRenderObject so that it inherits from a new class,
AccessibilityNodeObject, that can be constructed from a Node without a
renderer. Modifies AXObjectCache so that it automatically creates an
AccessibilityNodeObject for elements in a canvas subtree but not otherwise.
A new layout test verifies that this correctly exposes an accessibility
tree with appropriate roles for elements in a canvas subtree.

This patch does not try to complete the implementation of
AccessibilityNodeObject. Most AX methods are still unimplemented and need
to be migrated from AccessibilityRenderObject to AccessibilityNodeObject
in a future patch.

This patch also doesn't change anything outside of WebCore/accessibility, so
the rest of WebCore only calls AXObjectCache when there are changes to a
RenderObject, not to a Node. Accessible notifications on nodes without
renderers need to be implemented in a future patch.

Test: accessibility/canvas-accessibilitynodeobject.html

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::get):
(WebCore):
(WebCore::createFromNode):
(WebCore::AXObjectCache::getOrCreate):
(WebCore::AXObjectCache::remove):
* accessibility/AXObjectCache.h:
(AXObjectCache):
(WebCore::AXObjectCache::get):
(WebCore::AXObjectCache::getOrCreate):
(WebCore::AXObjectCache::remove):
* accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::AccessibilityARIAGrid):
(WebCore):
(WebCore::AccessibilityARIAGrid::~AccessibilityARIAGrid):
(WebCore::AccessibilityARIAGrid::init):
(WebCore::AccessibilityARIAGrid::create):
* accessibility/AccessibilityARIAGrid.h:
(AccessibilityARIAGrid):
* accessibility/AccessibilityARIAGridCell.cpp:
(WebCore::AccessibilityARIAGridCell::create):
* accessibility/AccessibilityARIAGridRow.cpp:
(WebCore::AccessibilityARIAGridRow::create):
* accessibility/AccessibilityAllInOne.cpp:
* accessibility/AccessibilityList.cpp:
(WebCore::AccessibilityList::create):
* accessibility/AccessibilityListBox.cpp:
(WebCore::AccessibilityListBox::create):
* accessibility/AccessibilityMediaControls.cpp:
(WebCore::AccessibilityMediaControl::create):
(WebCore::AccessibilityMediaControlsContainer::create):
(WebCore::AccessibilityMediaTimeline::create):
(WebCore::AccessibilityMediaTimeDisplay::create):
* accessibility/AccessibilityMenuList.cpp:
(WebCore::AccessibilityMenuList::create):
(WebCore):
* accessibility/AccessibilityMenuList.h:
(AccessibilityMenuList):
* accessibility/AccessibilityNodeObject.cpp: Added.
(WebCore):
(WebCore::AccessibilityNodeObject::AccessibilityNodeObject):
(WebCore::AccessibilityNodeObject::~AccessibilityNodeObject):
(WebCore::AccessibilityNodeObject::init):
(WebCore::AccessibilityNodeObject::create):
(WebCore::AccessibilityNodeObject::detach):
(WebCore::AccessibilityNodeObject::childrenChanged):
(WebCore::AccessibilityNodeObject::updateAccessibilityRole):
(WebCore::AccessibilityNodeObject::firstChild):
(WebCore::AccessibilityNodeObject::lastChild):
(WebCore::AccessibilityNodeObject::previousSibling):
(WebCore::AccessibilityNodeObject::nextSibling):
(WebCore::AccessibilityNodeObject::parentObjectIfExists):
(WebCore::AccessibilityNodeObject::parentObject):
(WebCore::AccessibilityNodeObject::elementRect):
(WebCore::AccessibilityNodeObject::setNode):
(WebCore::AccessibilityNodeObject::document):
(WebCore::AccessibilityNodeObject::determineAccessibilityRole):
(WebCore::AccessibilityNodeObject::addChildren):
(WebCore::AccessibilityNodeObject::accessibilityIsIgnored):
(WebCore::AccessibilityNodeObject::canSetFocusAttribute):
(WebCore::AccessibilityNodeObject::determineAriaRoleAttribute):
(WebCore::AccessibilityNodeObject::ariaRoleAttribute):
(WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent):
* accessibility/AccessibilityNodeObject.h: Added.
(WebCore):
(AccessibilityNodeObject):
(WebCore::AccessibilityNodeObject::isAccessibilityNodeObject):
(WebCore::AccessibilityNodeObject::node):
(WebCore::AccessibilityNodeObject::isDetached):
(WebCore::toAccessibilityNodeObject):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isAccessibilityNodeObject):
* accessibility/AccessibilityProgressIndicator.cpp:
(WebCore::AccessibilityProgressIndicator::create):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::AccessibilityRenderObject):
(WebCore::AccessibilityRenderObject::init):
(WebCore):
(WebCore::AccessibilityRenderObject::create):
(WebCore::AccessibilityRenderObject::detach):
(WebCore::AccessibilityRenderObject::setRenderer):
(WebCore::AccessibilityRenderObject::canHaveChildren):
(WebCore::AccessibilityRenderObject::addCanvasChildren):
(WebCore::AccessibilityRenderObject::addChildren):
* accessibility/AccessibilityRenderObject.h:
(AccessibilityRenderObject):
* accessibility/AccessibilitySlider.cpp:
(WebCore::AccessibilitySlider::create):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::AccessibilityTable):
(WebCore):
(WebCore::AccessibilityTable::~AccessibilityTable):
(WebCore::AccessibilityTable::init):
(WebCore::AccessibilityTable::create):
* accessibility/AccessibilityTable.h:
(AccessibilityTable):
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::create):
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::create):

LayoutTests:

This new test adds a bunch of elements to a normal container and the same elements to
a canvas subtree, then it iterates over all of the accessible objects within each
container and makes sure they have identical roles. Because we know the nodes in the
canvas subtree don't have renderers, this successfully tests that AccessibilityNodeObjects
are getting created for these nodes.

* accessibility/canvas-accessibilitynodeobject-expected.txt: Added.
* accessibility/canvas-accessibilitynodeobject.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123182 268f45cc-cd09-0410-ab3c-d52691b4dbfc
SVG not properly respecting max-width.
https://bugs.webkit.org/show_bug.cgi?id=91474

Source/WebCore: 

My previous checkin for 91474 accidentally inverted width and height in the division case for
the computation of height. When I fixed this inversion, I discovered that <object> elements
are in fact also broken with max-width handling, and that furthermore, trying to apply the same
max-width fix by calling RenderBox::computeReplacedLogicalWidth/Height failed because those methods
call intrinsicLogicalWidth()/Height(). Becuase m_intrinsicSize is out-of-date and does not reflect
the values we just obtained from the contentRenderer, we use the default 300x150 values for object
and fail to render.
        
In order to both fix SVG/<object> with max-width constraints and to keep <object> rendering correctly
even when there are no max-width constraints, I was forced to update the m_intrinsicSize immediately
in order to make sure that the RenderBox methods returned the right values when computing the width/height
constrained to max/min-width/height values.

Reviewed by Dan Bernstein.

Added two new tests in svg/as-image. One test covers non-rectangular images to test for the inversion
mistake I made. The second test applies a max-width to <object> and shows that we have never gotten
this right before. An existing test in svg/as-image/ already covers basic <object> use (and tests that
the intrinsic size of 300x150 is not used when an explicit non-percentage size is specified on the SVG
itself).

* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox):
Add a check to update m_intrinsicSize when we know it should apply, so that the calls to check against
min/max-width fetch this correct size.
        
* rendering/RenderReplaced.h:
(RenderReplaced):
Make m_intrinsicSize mutable because of the mutation that occurs during the method above. It may be
that we should re-evaluate whether all of these methods should be const, but this would impact RenderBox
methods as well, so I chose to hold off going down that rabbit hole.

LayoutTests: 

Reviewed by Dan Bernstein.

* svg/as-image/svg-intrinsic-size-rectangular-expected.html: Added.
* svg/as-image/svg-intrinsic-size-rectangular.html: Added.
* svg/as-image/svg-object-intrinsic-size-expected.html: Added.
* svg/as-image/svg-object-intrinsic-size.html: Added.



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