AX: Computed hierarchical level is not consistent with aria-level
https://bugs.webkit.org/show_bug.cgi?id=106638

Reviewed by Chris Fleizach.

Source/WebCore:

Make hierarchicalLevel computation 1-based to match the aria-level spec.

Extends an existing test: platform/mac/accessibility/aria-tree.html.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::hierarchicalLevel):
* accessibility/AccessibilityObject.h:
(AccessibilityObject):
* accessibility/mac/WebAccessibilityObjectWrapper.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

LayoutTests:

Extend aria-tree.html to check the hierarchicalLevel automatically
computed when aria-level is not provided. Make sure they're consistent.
Now, the mac disclosureLevel will be one less than the web aria-level.

* platform/mac/accessibility/aria-tree-expected.txt:
* platform/mac/accessibility/aria-tree.html:
* platform/mac/accessibility/aria-treegrid-expected.txt:
* platform/mac/accessibility/aria-treegrid.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139456 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[SVG] Suppress resource rebuilding for unattached and shadow elements
https://bugs.webkit.org/show_bug.cgi?id=106664

Reviewed by Dirk Schulze.

Source/WebCore:

SVGStyledElement::buildPendingResourcesIfNeeded() can be called while cloning a subtree
(as nodes are inserted into the clone, while still detached) or when elements are inserted
into the shadow tree. Both of these cases are problematic for SVGUseElement and can trigger
indirect recursion in SVGUseElement::buildPendingResource.

Since shadow and !inDocument() nodes are of no interest to ID dependents (they cannot be
found by ID in the document), the patch short-circuits buildPendingResource() for these
cases.

Test: svg/custom/use-rebuild-resources-crash.svg

* svg/SVGStyledElement.cpp:
(WebCore::SVGStyledElement::buildPendingResourcesIfNeeded):

LayoutTests:

* svg/custom/use-rebuild-resources-crash-expected.txt: Added.
* svg/custom/use-rebuild-resources-crash.svg: Added.


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