[Qt] Segmentation fault when closing QtTestBrowser
https://bugs.webkit.org/show_bug.cgi?id=95003

Patch by Roland Takacs <rtakacs@inf.u-szeged.hu> on 2012-09-12
Reviewed by Simon Hausmann.

Source/WebCore:

Defined a new QObject* variable.
If WebKit1 is used, it points to the QGLWidget that was
created in 'createPlatformGraphicsContext3DFromWidget'.
If WebKit2 is used, it points to the QWindow that was
created in GraphicsContext3DPrivate's constructor.
It is neccessary for deallocating them.

* platform/graphics/qt/GraphicsContext3DQt.cpp:
(GraphicsContext3DPrivate):
(WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
(WebCore::GraphicsContext3DPrivate::~GraphicsContext3DPrivate):
* platform/qt/QWebPageClient.h:
(QWebPageClient):

Source/WebKit/qt:

Defined a new QObject* variable that points to the QGLWidget that was created
in 'createPlatformGraphicsContext3DFromWidget'.
It is neccessary for deallocating it.

* WebCoreSupport/PageClientQt.cpp:
(createPlatformGraphicsContext3DFromWidget):
(WebCore::PageClientQWidget::createPlatformGraphicsContext3D):
(WebCore::PageClientQGraphicsWidget::createPlatformGraphicsContext3D):
* WebCoreSupport/PageClientQt.h:
(PageClientQWidget):
(PageClientQGraphicsWidget):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Remove unused getProcessMemorySize from PlatformSupport
https://bugs.webkit.org/show_bug.cgi?id=96520

Reviewed by Kentaro Hara.

Part of a refactoring series. See tracking bug 82948.

* platform/chromium/PlatformSupport.h:
(PlatformSupport):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128316 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Text Autosizing: Don't autosize text in constrained height elements.
https://bugs.webkit.org/show_bug.cgi?id=96143

Patch by John Mellor <johnme@chromium.org> on 2012-09-12
Reviewed by Julien Chaffraix.

Source/WebCore:

Autosizing text within constained height elements usually goes badly,
as the autosized text will wrap onto more lines, hence it will become
taller and often overflow its container, breaking the page's layout.

This patch disables autosizing for blocks with a fixed height ancestor
(or which are fixed height themselves), unless the lowest such ancestor
(or one of the ancestors in between it and the text block) has
overflow-y:auto/scroll, in which case the height isn't really fixed.

Tests: fast/text-autosizing/constrained-and-overflow-auto-ancestor.html
       fast/text-autosizing/constrained-and-overflow-hidden-ancestor.html
       fast/text-autosizing/constrained-and-overflow-paged-x-ancestor.html
       fast/text-autosizing/constrained-and-overflow-scroll-ancestor.html
       fast/text-autosizing/constrained-height-ancestor.html
       fast/text-autosizing/constrained-maxheight-ancestor.html
       fast/text-autosizing/constrained-maxheight.html
       fast/text-autosizing/constrained-percent-maxheight.html
       fast/text-autosizing/constrained-percent-of-viewport-maxheight.html
       fast/text-autosizing/constrained-then-overflow-ancestors.html
       fast/text-autosizing/constrained-then-overflow-then-positioned-ancestors.html
       fast/text-autosizing/constrained-then-position-absolute-ancestors.html
       fast/text-autosizing/constrained-then-position-fixed-ancestors.html
       fast/text-autosizing/constrained-within-overflow-ancestor.html

* rendering/TextAutosizer.cpp:
(WebCore::TextAutosizer::processBox):

    Skips boxes for which contentHeightIsConstrained returns true.

(WebCore::TextAutosizer::contentHeightIsConstrained):

    Walks up the render tree until it finds either a constrained height
    or overflow-y:auto/scroll ancestor.

LayoutTests:

Added tests with various kinds, orders and nestings of constrained
height, overflow-y and positioned elements.

* fast/text-autosizing/constrained-and-overflow-auto-ancestor-expected.html: Added.
* fast/text-autosizing/constrained-and-overflow-auto-ancestor.html: Added.
* fast/text-autosizing/constrained-and-overflow-hidden-ancestor-expected.html: Added.
* fast/text-autosizing/constrained-and-overflow-hidden-ancestor.html: Added.
* fast/text-autosizing/constrained-and-overflow-paged-x-ancestor-expected.html: Added.
* fast/text-autosizing/constrained-and-overflow-paged-x-ancestor.html: Added.
* fast/text-autosizing/constrained-and-overflow-scroll-ancestor-expected.html: Added.
* fast/text-autosizing/constrained-and-overflow-scroll-ancestor.html: Added.
* fast/text-autosizing/constrained-height-ancestor-expected.html: Added.
* fast/text-autosizing/constrained-height-ancestor.html: Added.
* fast/text-autosizing/constrained-maxheight-ancestor-expected.html: Added.
* fast/text-autosizing/constrained-maxheight-ancestor.html: Added.
* fast/text-autosizing/constrained-maxheight-expected.html: Added.
* fast/text-autosizing/constrained-maxheight.html: Added.
* fast/text-autosizing/constrained-percent-maxheight-expected.html: Added.
* fast/text-autosizing/constrained-percent-maxheight.html: Added.
* fast/text-autosizing/constrained-percent-of-viewport-maxheight-expected.html: Added.
* fast/text-autosizing/constrained-percent-of-viewport-maxheight.html: Added.
* fast/text-autosizing/constrained-then-overflow-ancestors-expected.html: Added.
* fast/text-autosizing/constrained-then-overflow-ancestors.html: Added.
* fast/text-autosizing/constrained-then-overflow-then-positioned-ancestors-expected.html: Added.
* fast/text-autosizing/constrained-then-overflow-then-positioned-ancestors.html: Added.
* fast/text-autosizing/constrained-then-position-absolute-ancestors-expected.html: Added.
* fast/text-autosizing/constrained-then-position-absolute-ancestors.html: Added.
* fast/text-autosizing/constrained-then-position-fixed-ancestors-expected.html: Added.
* fast/text-autosizing/constrained-then-position-fixed-ancestors.html: Added.
* fast/text-autosizing/constrained-within-overflow-ancestor-expected.html: Added.
* fast/text-autosizing/constrained-within-overflow-ancestor.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128317 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: Refactor most AccessibilityRenderObject code into AccessibilityNodeObject
https://bugs.webkit.org/show_bug.cgi?id=96323

Reviewed by Chris Fleizach.

Source/WebCore:

This patch is large, but it's at least 75% cut-and-paste.

All it does is move the implementation of a large chunk of
AccessibilityRenderObject methods to AccessibilityNodeObject
instead. This allows them to operate on elements without
renderers, such as those in canvas fallback content. It also
moves us towards the goal where AccessibilityRenderObject
only has code that's specific to renderers and not just nodes.

Half of the methods cut and paste with essentially no changes.
Some required just tiny changes to access an attribute via the
element (e.g. HTMLSelectElement) rather than its associated
renderer (e.g. RenderMenuList). A few were a little trickier,
as the behavior needs to be slightly different when there's a
renderer. In those last cases, as much of the code as possible is
in AccessibilityNodeObject and AccessibilityRenderObject overrides
it as necessary.

Test: accessibility/canvas-fallback-content-2.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::determineAccessibilityRole):
(WebCore::AccessibilityNodeObject::canHaveChildren):
(WebCore):
(WebCore::AccessibilityNodeObject::accessibilityIsIgnored):
(WebCore::AccessibilityNodeObject::isWebArea):
(WebCore::AccessibilityNodeObject::isImageButton):
(WebCore::AccessibilityNodeObject::isAnchor):
(WebCore::AccessibilityNodeObject::isNativeTextControl):
(WebCore::AccessibilityNodeObject::isSearchField):
(WebCore::AccessibilityNodeObject::isNativeImage):
(WebCore::AccessibilityNodeObject::isImage):
(WebCore::AccessibilityNodeObject::isPasswordField):
(WebCore::AccessibilityNodeObject::isInputImage):
(WebCore::AccessibilityNodeObject::isProgressIndicator):
(WebCore::AccessibilityNodeObject::isSlider):
(WebCore::AccessibilityNodeObject::isMenuRelated):
(WebCore::AccessibilityNodeObject::isMenu):
(WebCore::AccessibilityNodeObject::isMenuBar):
(WebCore::AccessibilityNodeObject::isMenuButton):
(WebCore::AccessibilityNodeObject::isMenuItem):
(WebCore::AccessibilityNodeObject::isNativeCheckboxOrRadio):
(WebCore::AccessibilityNodeObject::isEnabled):
(WebCore::AccessibilityNodeObject::isIndeterminate):
(WebCore::AccessibilityNodeObject::isPressed):
(WebCore::AccessibilityNodeObject::isChecked):
(WebCore::AccessibilityNodeObject::isHovered):
(WebCore::AccessibilityNodeObject::isMultiSelectable):
(WebCore::AccessibilityNodeObject::isReadOnly):
(WebCore::AccessibilityNodeObject::isRequired):
(WebCore::AccessibilityNodeObject::headingLevel):
(WebCore::AccessibilityNodeObject::valueDescription):
(WebCore::AccessibilityNodeObject::isARIARange):
(WebCore::AccessibilityNodeObject::valueForRange):
(WebCore::AccessibilityNodeObject::maxValueForRange):
(WebCore::AccessibilityNodeObject::minValueForRange):
(WebCore::AccessibilityNodeObject::stepValueForRange):
(WebCore::AccessibilityNodeObject::isHeading):
(WebCore::AccessibilityNodeObject::isLink):
(WebCore::AccessibilityNodeObject::isControl):
(WebCore::AccessibilityNodeObject::isFieldset):
(WebCore::AccessibilityNodeObject::isGroup):
(WebCore::AccessibilityNodeObject::selectedRadioButton):
(WebCore::AccessibilityNodeObject::selectedTabItem):
(WebCore::AccessibilityNodeObject::checkboxOrRadioValue):
(WebCore::AccessibilityNodeObject::anchorElement):
(WebCore::AccessibilityNodeObject::actionElement):
(WebCore::AccessibilityNodeObject::mouseButtonListener):
(WebCore::AccessibilityNodeObject::isDescendantOfBarrenParent):
(WebCore::AccessibilityNodeObject::alterSliderValue):
(WebCore::AccessibilityNodeObject::increment):
(WebCore::AccessibilityNodeObject::decrement):
(WebCore::AccessibilityNodeObject::changeValueByStep):
(WebCore::AccessibilityNodeObject::changeValueByPercent):
(WebCore::AccessibilityNodeObject::isGenericFocusableElement):
(WebCore::AccessibilityNodeObject::labelForElement):
(WebCore::AccessibilityNodeObject::ariaAccessibilityDescription):
(WebCore::siblingWithAriaRole):
(WebCore::AccessibilityNodeObject::menuElementForMenuButton):
(WebCore::AccessibilityNodeObject::menuForMenuButton):
(WebCore::AccessibilityNodeObject::menuItemElementForMenu):
(WebCore::AccessibilityNodeObject::menuButtonForMenu):
(WebCore::AccessibilityNodeObject::accessibilityDescription):
(WebCore::AccessibilityNodeObject::helpText):
(WebCore::AccessibilityNodeObject::hierarchicalLevel):
(WebCore::AccessibilityNodeObject::textUnderElement):
(WebCore::AccessibilityNodeObject::title):
(WebCore::AccessibilityNodeObject::text):
(WebCore::AccessibilityNodeObject::stringValue):
(WebCore::accessibleNameForNode):
(WebCore::AccessibilityNodeObject::accessibilityDescriptionForElements):
(WebCore::AccessibilityNodeObject::elementsFromAttribute):
(WebCore::AccessibilityNodeObject::ariaLabeledByElements):
(WebCore::AccessibilityNodeObject::ariaLabeledByAttribute):
(WebCore::AccessibilityNodeObject::canSetFocusAttribute):
* accessibility/AccessibilityNodeObject.h:
(AccessibilityNodeObject):
(WebCore::AccessibilityNodeObject::node):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::parentObject):
(WebCore):
(WebCore::AccessibilityRenderObject::isReadOnly):
(WebCore::AccessibilityRenderObject::helpText):
(WebCore::AccessibilityRenderObject::accessibilityDescription):
(WebCore::AccessibilityRenderObject::text):
(WebCore::AccessibilityRenderObject::contentChanged):
(WebCore::AccessibilityRenderObject::canHaveChildren):
* accessibility/AccessibilityRenderObject.h:
(AccessibilityRenderObject):
(WebCore::AccessibilityRenderObject::setRenderObject):

LayoutTests:

New test that compares accessibility attributes of lots of elements
inside and outside of canvas fallback content, to make sure they're
the same. Designed to be cross-platform because it just asserts the
attributes are the same in both contexts, rather than expecting specific
values.

* accessibility/canvas-fallback-content-2-expected.txt: Added.
* accessibility/canvas-fallback-content-2.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Flakiness dashboard doesn't recognize new Chromium Android test builder
https://bugs.webkit.org/show_bug.cgi?id=96523

Reviewed by Ojan Vafai.

Properly return 'ANDROID' as the Chromium platform for Android builders.

* TestResultServer/static-dashboards/flakiness_dashboard.js:
(chromiumPlatform):
* TestResultServer/static-dashboards/flakiness_dashboard_unittests.js:
(test):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Remove unused allowScriptDespiteSettings function from PlatformSupport
https://bugs.webkit.org/show_bug.cgi?id=96526

Reviewed by Kentaro Hara.

Part of a refactoring series. See tracking bug 82948.

* platform/chromium/PlatformSupport.h:
(PlatformSupport):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128322 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Shadow DOM] Unpolished elements should reject author shadows
https://bugs.webkit.org/show_bug.cgi?id=96404

Reviewed by Dimitri Glazkov.

Source/WebCore:

Gave areAuthorShadowsAllowed() overrides for these replaced elements
which aren't author shadow ready.

No new tests. Covered by existing tests.

* html/HTMLCanvasElement.h: Did areAuthorShadowsAllowed() overrride.
* html/HTMLFieldSetElement.h: Did areAuthorShadowsAllowed() overrride.
* html/HTMLFrameElementBase.h: Did areAuthorShadowsAllowed() overrride.
* html/HTMLMediaElement.h: Did areAuthorShadowsAllowed() overrride.
* html/HTMLPlugInElement.h: Did areAuthorShadowsAllowed() overrride.
* html/HTMLSelectElement.h: Did areAuthorShadowsAllowed() overrride.

LayoutTests:

- Added setAuthorShadowDOMForAnyElementEnabled() calls to make tests works.
- UPdated shadow-disable.html to capture the disabled elements.

* fast/dom/shadow/shadow-disable-expected.txt:
* fast/dom/shadow/shadow-disable.html:
* fast/dom/shadow/shadowdom-for-fieldset-without-shadow.html:
* fast/dom/shadow/shadowdom-for-form-associated-element-useragent.html:
* fast/dom/shadow/shadowdom-for-media.html:
* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128323 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] remove deprecated and unused sets import from chromium_android driver
https://bugs.webkit.org/show_bug.cgi?id=96485

Reviewed by Dirk Pranke.

* Scripts/webkitpy/layout_tests/port/chromium_android.py:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128324 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSSRegions]Use RefPtr's instead of weak references on DOMNamedFlowCollection
https://bugs.webkit.org/show_bug.cgi?id=95311

Patch by Andrei Onea <onea@adobe.com> on 2012-09-12
Reviewed by Andreas Kling.

Source/WebCore:

Currently, DOMNamedFlowCollection holds a collection of raw pointers to WebKitNamedFlow.
This causes a crash when there is a JS instance of a NamedFlowCollection snapshot taken
before the NamedFlow is deleted, since the memory previously occupied by the NamedFlow
can be accessed. Because of this, we need to use RefPtr's for the snapshot, so that such
dangling references extend the lifetime of the NamedFlow objects.

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

* dom/DOMNamedFlowCollection.cpp:
(WebCore::DOMNamedFlowCollection::DOMNamedFlowCollection):
(WebCore::DOMNamedFlowCollection::item):
(WebCore::DOMNamedFlowCollection::namedItem):
(WebCore):
(WebCore::DOMNamedFlowCollection::DOMNamedFlowHashFunctions::hash):
(WebCore::DOMNamedFlowCollection::DOMNamedFlowHashFunctions::equal):
(DOMNamedFlowCollection::DOMNamedFlowHashFunctions):
(WebCore::DOMNamedFlowCollection::DOMNamedFlowHashTranslator::hash):
(WebCore::DOMNamedFlowCollection::DOMNamedFlowHashTranslator::equal):
Create new internal ListHashSet for RefPtr<WebKitNamedFlow>.
* dom/DOMNamedFlowCollection.h:
(WebCore::DOMNamedFlowCollection::create):
(DOMNamedFlowCollection):
* dom/NamedFlowCollection.cpp:
(WebCore::NamedFlowCollection::createCSSOMSnapshot):
(WebCore):
(WebCore::NamedFlowCollection::NamedFlowHashFunctions::hash):
(WebCore::NamedFlowCollection::NamedFlowHashFunctions::equal):
(NamedFlowCollection::NamedFlowHashFunctions):
(WebCore::NamedFlowCollection::NamedFlowHashTranslator::hash):
(WebCore::NamedFlowCollection::NamedFlowHashTranslator::equal):
Move back the definitions for NamedFlowHashFunctions and NamedFlowHashTranslator
to the .cpp file.
* dom/NamedFlowCollection.h:
(NamedFlowCollection):

LayoutTests:

Added test for crash which occurs when there is a raw pointer to a NamedFlow
(in a NamedFlowCollection) which has been freed.

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

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