MathML: nested square root symbols have varying descenders
https://bugs.webkit.org/show_bug.cgi?id=43819

Reviewed by Eric Seidel.

Source/WebCore: 

This bug stems from the use of offsetHeight() on a renderer that's possibly a
RenderInline, in getBoxModelObjectHeight() in RenderMathMLBlock.h.
RenderInline::offsetHeight() actually returns linesBoundingBox().height(), which can be
overly large, especially for the big STIX fonts that include a few mathematical symbols
with unusually tall ascenders or descenders. A better solution for MathML in general is
the CSS properties { -webkit-line-box-contain: glyphs replaced; line-height: 0; }. This
gives tight glyph-based formatting in radical expressions, subscripts, superscripts,
underscripts, overscripts, numerators, denominators, etc. To make this work, inline
elements such as <mn> and <mi> must be wrapped inside implicit <mrow>s or just
RenderMathMLBlocks, when a tight height is desired. We also replace
getBoxModelObjectWidth(), which uses offsetWidth(), with contentLogicalWidth(). Finally,
we enable the STIXGeneral font for use inside layout tests.

Tested by existing LayoutTests/mathml/presentation/ files including roots.xhtml.

* css/mathml.css:
(math):
(mtext):
(mroot > * + *):
(mtd):
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::preferredLogicalHeightAfterSizing):
(WebCore::RenderMathMLBlock::baselinePosition):
* rendering/mathml/RenderMathMLBlock.h:
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::baselinePosition):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::createStackableStyle):
(WebCore::RenderMathMLOperator::baselinePosition):
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::addChild):
(WebCore::RenderMathMLRoot::computePreferredLogicalWidths):
(WebCore::RenderMathMLRoot::paint):
* rendering/mathml/RenderMathMLRoot.h:
* rendering/mathml/RenderMathMLSquareRoot.cpp:
* rendering/mathml/RenderMathMLSquareRoot.h:
* rendering/mathml/RenderMathMLSubSup.cpp:
(WebCore::RenderMathMLSubSup::layout):
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::baselinePosition):
* rendering/mathml/RenderMathMLUnderOver.h:

Tools: 

Allow the STIXGeneral font to be used during layout tests, especially for MathML.

* DumpRenderTree/mac/DumpRenderTree.mm:
(allowedFontFamilySet):
* WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm:
(WTR::allowedFontFamilySet):

LayoutTests: 

These tests are rebaselined to use the STIXGeneral font, and tight glyph-based MathML
layout using the CSS properties
{ -webkit-line-box-contain: glyphs replaced; line-height: 0; }.

* mathml/presentation/style.xhtml:
* platform/mac/mathml/presentation/attributes-expected.png:
* platform/mac/mathml/presentation/attributes-expected.txt:
* platform/mac/mathml/presentation/fenced-expected.png:
* platform/mac/mathml/presentation/fenced-expected.txt:
* platform/mac/mathml/presentation/fenced-mi-expected.png:
* platform/mac/mathml/presentation/fenced-mi-expected.txt:
* platform/mac/mathml/presentation/fractions-expected.png:
* platform/mac/mathml/presentation/fractions-expected.txt:
* platform/mac/mathml/presentation/fractions-vertical-alignment-expected.png:
* platform/mac/mathml/presentation/fractions-vertical-alignment-expected.txt:
* platform/mac/mathml/presentation/mo-expected.png:
* platform/mac/mathml/presentation/mo-expected.txt:
* platform/mac/mathml/presentation/mo-stretch-expected.png:
* platform/mac/mathml/presentation/mo-stretch-expected.txt:
* platform/mac/mathml/presentation/mroot-pref-width-expected.png:
* platform/mac/mathml/presentation/mroot-pref-width-expected.txt:
* platform/mac/mathml/presentation/over-expected.png:
* platform/mac/mathml/presentation/over-expected.txt:
* platform/mac/mathml/presentation/roots-expected.png:
* platform/mac/mathml/presentation/roots-expected.txt:
* platform/mac/mathml/presentation/row-alignment-expected.png:
* platform/mac/mathml/presentation/row-alignment-expected.txt:
* platform/mac/mathml/presentation/row-expected.png:
* platform/mac/mathml/presentation/row-expected.txt:
* platform/mac/mathml/presentation/style-expected.png:
* platform/mac/mathml/presentation/style-expected.txt:
* platform/mac/mathml/presentation/sub-expected.png:
* platform/mac/mathml/presentation/sub-expected.txt:
* platform/mac/mathml/presentation/subsup-expected.png:
* platform/mac/mathml/presentation/subsup-expected.txt:
* platform/mac/mathml/presentation/sup-expected.png:
* platform/mac/mathml/presentation/sup-expected.txt:
* platform/mac/mathml/presentation/tables-expected.png:
* platform/mac/mathml/presentation/tables-expected.txt:
* platform/mac/mathml/presentation/tokenElements-expected.png:
* platform/mac/mathml/presentation/tokenElements-expected.txt:
* platform/mac/mathml/presentation/under-expected.png:
* platform/mac/mathml/presentation/under-expected.txt:
* platform/mac/mathml/presentation/underover-expected.png:
* platform/mac/mathml/presentation/underover-expected.txt:
* platform/mac/mathml/xHeight-expected.png:
* platform/mac/mathml/xHeight-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124512 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Add CCScrollbarAnimationController class for compositor scrollbar animation
https://bugs.webkit.org/show_bug.cgi?id=91688

Patch by Tien-Ren Chen <trchen@chromium.org> on 2012-08-02
Reviewed by Adrienne Walker.

Source/WebCore:

Add CCScrollbarAnimationController that serves as the middle man
between the scrolling layer and scrollbar layer. Now all scroll offset
information are pushed through the controller, and individual platform
can provide specialized controller for extra processing.

A basic fadeout controller for Android scrollbar is included.

New test: ScrollbarLayerChromiumTest.scrollOffsetSynchronization
          CCScrollbarAnimationControllerLinearFade.*

* WebCore.gypi:
* page/FrameView.cpp:
(WebCore::FrameView::calculateScrollbarModesForLayout):
* page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
(WebCore::createScrollbarLayer):
* platform/graphics/chromium/TreeSynchronizer.cpp:
(WebCore::TreeSynchronizer::synchronizeTreeRecursive):
(WebCore::TreeSynchronizer::updateScrollbarLayerPointersRecursive):
* platform/graphics/chromium/cc/CCLayerImpl.cpp:
(WebCore::CCLayerImpl::scrollBy):
(WebCore::CCLayerImpl::setMaxScrollPosition):
(WebCore):
(WebCore::CCLayerImpl::horizontalScrollbarLayer):
(WebCore::CCLayerImpl::setHorizontalScrollbarLayer):
(WebCore::CCLayerImpl::verticalScrollbarLayer):
(WebCore::CCLayerImpl::setVerticalScrollbarLayer):
* platform/graphics/chromium/cc/CCLayerImpl.h:
(WebCore):
(CCLayerImpl):
(WebCore::CCLayerImpl::scrollbarAnimationController):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::animate):
(WebCore::CCLayerTreeHostImpl::pinchGestureBegin):
(WebCore::CCLayerTreeHostImpl::pinchGestureUpdate):
(WebCore::CCLayerTreeHostImpl::pinchGestureEnd):
(WebCore::CCLayerTreeHostImpl::animateScrollbars):
(WebCore):
(WebCore::CCLayerTreeHostImpl::animateScrollbarsRecursive):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
(CCLayerTreeHostImpl):
* platform/graphics/chromium/cc/CCScrollbarAnimationController.cpp: Added.
(WebCore):
(WebCore::CCScrollbarAnimationController::create):
(WebCore::CCScrollbarAnimationController::CCScrollbarAnimationController):
(WebCore::CCScrollbarAnimationController::~CCScrollbarAnimationController):
(WebCore::CCScrollbarAnimationController::getScrollLayerBounds):
(WebCore::CCScrollbarAnimationController::updateScrollOffset):
* platform/graphics/chromium/cc/CCScrollbarAnimationController.h: Added.
(WebCore):
(CCScrollbarAnimationController):
(WebCore::CCScrollbarAnimationController::animate):
(WebCore::CCScrollbarAnimationController::didPinchGestureBegin):
(WebCore::CCScrollbarAnimationController::didPinchGestureUpdate):
(WebCore::CCScrollbarAnimationController::didPinchGestureEnd):
(WebCore::CCScrollbarAnimationController::setHorizontalScrollbarLayer):
(WebCore::CCScrollbarAnimationController::horizontalScrollbarLayer):
(WebCore::CCScrollbarAnimationController::setVerticalScrollbarLayer):
(WebCore::CCScrollbarAnimationController::verticalScrollbarLayer):
* platform/graphics/chromium/cc/CCScrollbarAnimationControllerAndroid.cpp: Added.
(WebCore):
(WebCore::CCScrollbarAnimationController::create):
(WebCore::CCScrollbarAnimationControllerAndroid::CCScrollbarAnimationControllerAndroid):
(WebCore::CCScrollbarAnimationControllerAndroid::~CCScrollbarAnimationControllerAndroid):
(WebCore::CCScrollbarAnimationControllerAndroid::animate):
(WebCore::CCScrollbarAnimationControllerAndroid::didPinchGestureUpdate):
(WebCore::CCScrollbarAnimationControllerAndroid::didPinchGestureEnd):
(WebCore::CCScrollbarAnimationControllerAndroid::updateScrollOffset):
(WebCore::CCScrollbarAnimationControllerAndroid::opacityAtTime):
* platform/graphics/chromium/cc/CCScrollbarAnimationControllerAndroid.h: Added.
(WebCore):
(CCScrollbarAnimationControllerAndroid):
* platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp:
(WebCore::CCScrollbarLayerImpl::CCScrollbarLayerImpl):
(WebCore):
(WebCore::CCScrollbarLayerImpl::CCScrollbar::value):
(WebCore::CCScrollbarLayerImpl::CCScrollbar::currentPos):
(WebCore::CCScrollbarLayerImpl::CCScrollbar::totalSize):
(WebCore::CCScrollbarLayerImpl::CCScrollbar::maximum):
* platform/graphics/chromium/cc/CCScrollbarLayerImpl.h:
(WebCore::CCScrollbarLayerImpl::orientation):
(WebCore::CCScrollbarLayerImpl::setCurrentPos):
(WebCore::CCScrollbarLayerImpl::setTotalSize):
(WebCore::CCScrollbarLayerImpl::setMaximum):
(CCScrollbarLayerImpl):

Source/WebKit/chromium:

New unit test ScrollbarLayerChromiumTest.scrollOffsetSynchronization to verify
scroll offset is updated during tree synchronization and threaded scrolling.
Another new unit test CCScrollbarAnimationControllerLinearFadeTest to verify
opacity animates as intended.

* tests/ScrollbarLayerChromiumTest.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124513 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Let XCode have its own away and also sort the files.

* WebCore.xcodeproj/project.pbxproj:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124514 268f45cc-cd09-0410-ab3c-d52691b4dbfc
BindingSecurityBase serves no purpose and should be removed
https://bugs.webkit.org/show_bug.cgi?id=93025

Reviewed by Eric Seidel.

Now that we don't use templates in the generic bindings, we can merge
BindingSecurity and BindingSecurityBase. This patch also removes some
functions that are no longer used (and reduces the number of
#includes).

No behavior change.

* GNUmakefile.list.am:
* WebCore.gypi:
* bindings/generic/BindingSecurity.h:
(WebCore):
(BindingSecurity):
* bindings/generic/BindingSecurityBase.cpp: Removed.
* bindings/generic/BindingSecurityBase.h: Removed.
* bindings/v8/V8Binding.h:
* bindings/v8/V8Utilities.cpp:
* bindings/v8/custom/V8MutationObserverCustom.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Remove dependency on Scrollbar.h from ScrollbarLayerChromium
https://bugs.webkit.org/show_bug.cgi?id=93024

Reviewed by James Robinson.

Change part enum from the Scrollbar version to WebScrollbar's.

Tested by composited layout tests.

* platform/graphics/chromium/ScrollbarLayerChromium.cpp:
(WebCore::ScrollbarBackgroundPainter::create):
(WebCore::ScrollbarBackgroundPainter::ScrollbarBackgroundPainter):
(ScrollbarBackgroundPainter):
(WebCore::ScrollbarLayerChromium::createTextureUpdaterIfNeeded):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124516 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add back a header I mistakenly removed in my previous commit.

* WebCore.xcodeproj/project.pbxproj:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Built in quotes don't use lang attribute
https://bugs.webkit.org/show_bug.cgi?id=92918

Patch by Elliott Sprehn <esprehn@gmail.com> on 2012-08-02
Reviewed by Alexey Proskuryakov.

Source/WebCore:

Previously even though there was a table in RenderQuote of languages mapped
to quotes we always used basic quotes. This patch removes the broken tree
walking and uses Element::computeInheritedLanguage fixing this.

Tests: fast/css-generated-content/quotes-lang-expected.html
       fast/css-generated-content/quotes-lang.html
       fast/css-generated-content/quotes-xml-lang-expected.html
       fast/css-generated-content/quotes-xml-lang.html

* rendering/RenderQuote.cpp:
(WebCore::RenderQuote::originalText):
(WebCore::RenderQuote::quotesData): New method that determines the right QuotesData to use.
(WebCore):
* rendering/RenderQuote.h:
(RenderQuote):

LayoutTests:

Add a test that the built in quote languages are used and that custom
languages work as well. This also tests that xml:lang takes precedence
over lang.

* fast/css-generated-content/quotes-lang-expected.html: Added.
* fast/css-generated-content/quotes-lang.html: Added.
* fast/css-generated-content/quotes-xml-lang-expected.html: Added.
* fast/css-generated-content/quotes-xml-lang.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124518 268f45cc-cd09-0410-ab3c-d52691b4dbfc
scripts in formaction should be stripped upon paste
https://bugs.webkit.org/show_bug.cgi?id=92298

Reviewed by Eric Seidel.

Source/WebCore:

Strip formaction attribute values when the URL is of javascript protocol.

Test: editing/pasteboard/paste-noscript-xhtml.html
      editing/pasteboard/paste-noscript.html

* dom/Element.cpp:
(WebCore::isAttributeToRemove): Explicitly compare with href and nohref instead of comparing
the ends of strings since comparing two AtomicString is much faster.

LayoutTests:

Added formaction attributes to tests.

* editing/pasteboard/paste-noscript-expected.txt:
* editing/pasteboard/paste-noscript-xhtml-expected.txt:
* editing/pasteboard/paste-noscript.html:
* editing/pasteboard/resources/paste-noscript-content.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124520 268f45cc-cd09-0410-ab3c-d52691b4dbfc
test-webkitpy can fail on a clean checkout
https://bugs.webkit.org/show_bug.cgi?id=93039

Reviewed by Adam Barth.

Now that we run tests in parallel that can cause the installer
to try and install packages in parallel (even the same package),
and that probably won't work. We fix this by autoinstalling
everything up front (serially).

* Scripts/webkitpy/test/main.py:
(Tester._run_tests):
* Scripts/webkitpy/thirdparty/__init__.py:
(autoinstall_everything):

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