[BlackBerry] Web page renders at the wrong zoom level after viewport changes
https://bugs.webkit.org/show_bug.cgi?id=100096

Patch by Robin Cao <robin.cao@torchmobile.com.cn> on 2012-10-23
Reviewed by Rob Buis.

Notify the client of the zoom level change before resuming screen updates.
Otherwise, the user interface thread may blit the content at the wrong
zoom level in some cases. This can also prevent potential flickering.

Reviewed internally by Arvid Nilsson.

PR #225741

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::zoomAboutPoint):
(BlackBerry::WebKit::WebPagePrivate::zoomBlock):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132290 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r131421): Text baseline is not aligned in some locales
https://bugs.webkit.org/show_bug.cgi?id=100088

Reviewed by Hajime Morita.

Source/WebCore:

Before this patch, the element with ::-webkit-datetime-edit had
-webkit-align-items:center. It was incorrect at all because it
ignores baselines of each of inner fields. We need to change it to
-webkit-align-items:baseline, or stop using -webkit-flex.

However -webkit-align-items:baseline doesn't work because a spin
button element in the element doesn't have the baseline. If we
specified -webkit-align-items:baseline, the spin button would
shift up.

So, we change the element structure for multiple fields input
elements. Before this patch, the structure was:

input
  |
   - ::-webkit-date-and-time-container (flex cotainer)
     |
     |- ::-webkit-datetime-edit (has flexibility in date-and-time-container, also this is a flex container)
     |  |- ::-webkit-datetime-edit-foo
     |  |      :
     |  |
     |  |- ::-webkit-date-time-edit-gap  (has flexibility in datetime-edit)
     |   - ::-webkit-inne-spin-button
      - ::-webkit-calendar-picker-indicator

After the patch, the structure will be:

input
  |
   - ::-webkit-date-and-time-container (flexible box)
     |
     |- ::-webkit-datetime-edit (has flexibility in date-and-time-container)
     |  |- ::-webkit-datetime-edit-foo
     |  |      :
     |  |
     |
     |- ::-webkit-inne-spin-button
      - ::-webkit-calendar-picker-indicator

Because the spin button owner is date-and-time-container, we don't
need to make the datetime-edit element a flex container.

Also, we had rounding error by subpixel layout. To avoid it, we
stop using fractional paddings.

In order to implement this, we need to change the SpinButtonOwner
interface provider from DateTimeEditElement to
BaseMultipleFieldsDateAndTimeInputType.

No new tests. Covered by month-multiple-fields-appearance-l10n.html.

* css/html.css:
(input::-webkit-datetime-edit): Stop making this a flex
container. Inner fields in this use the single baseline.
(input::-webkit-datetime-edit-ampm-field):
Don't use fractional paddings to avoid rounding erros of subpixel
layout.  Use integral margin instead to avoid overwrap of focus
ring and background-color of the field.
(input::-webkit-datetime-edit-day-field): Ditto.
(input::-webkit-datetime-edit-hour-field): Ditto.
(input::-webkit-datetime-edit-millisecond-field): Ditto.
(input::-webkit-datetime-edit-minute-field): Ditto.
(input::-webkit-datetime-edit-month-field): Ditto.
(input::-webkit-datetime-edit-second-field): Ditto.
(input::-webkit-datetime-edit-week-field): Ditto.
(input::-webkit-datetime-edit-year-field): Ditto.
(input::-webkit-date-and-time-container): Ditto.

* html/BaseMultipleFieldsDateAndTimeInputType.h:
(BaseMultipleFieldsDateAndTimeInputType): Overrides
SpinButtonOwner functions, and add m_spinButtonElement.
* html/BaseMultipleFieldsDateAndTimeInputType.cpp:
(WebCore::BaseMultipleFieldsDateAndTimeInputType::focusAndSelectSpinButtonOwner):
Just delegate to DateTimeEditElement::focusIfNoFocus.
(WebCore::BaseMultipleFieldsDateAndTimeInputType::shouldSpinButtonRespondToMouseEvents):
Moved from DateTimeEditElement::shouldSpinButtonRespondToMouseEvents.
(WebCore::BaseMultipleFieldsDateAndTimeInputType::shouldSpinButtonRespondToWheelEvents):
Moved from DateTimeEditElement::shouldSpinButtonRespondToWheelEvents.
(WebCore::BaseMultipleFieldsDateAndTimeInputType::spinButtonStepDown):
Delegate to DateTimeEditElement::stepDown.
(WebCore::BaseMultipleFieldsDateAndTimeInputType::spinButtonStepUp):
Delegate to DateTimeEditElement::stepUp.
(WebCore::BaseMultipleFieldsDateAndTimeInputType::BaseMultipleFieldsDateAndTimeInputType):
Initialize m_spinButtonElement.
(WebCore::BaseMultipleFieldsDateAndTimeInputType::~BaseMultipleFieldsDateAndTimeInputType):
Reset SpinButtonOwner for m_spinButtonElement like the old code of ~DateTimeEditElement.
(WebCore::BaseMultipleFieldsDateAndTimeInputType::createShadowSubtree):
Put a SpinButtonElement between the DateTimeEditElement and the PickerIndicatorElement.
(WebCore::BaseMultipleFieldsDateAndTimeInputType::forwardEvent):
Take care of SpinButtonElement.
(WebCore::BaseMultipleFieldsDateAndTimeInputType::disabledAttributeChanged):
Release capture of SpinButtonElement. This corresponds to the old
code of DateTimeEditElement::updateUIState.
(WebCore::BaseMultipleFieldsDateAndTimeInputType::readonlyAttributeChanged): Ditto.

* html/TextFieldInputType.h:
Make SpinButtonElement::SpinButtonOwner protected to allow overriding.

* html/shadow/DateTimeEditElement.h:
(DateTimeEditElement): Remove SpniButtonOwner implementation,
m_spinButton, and rename some functions.
* html/shadow/DateTimeEditElement.cpp:
(WebCore::DateTimeEditElement::DateTimeEditElement):
Remove m_spinButton.
(WebCore::DateTimeEditElement::~DateTimeEditElement): Ditto.
(WebCore::DateTimeEditElement::focusIfNoFocus):
Renamed from focusAndSelectSpinButtonOwner. This is called
BaseMultipleFieldsDateAndTimeInputType::focusAndSelectSpinButtonOwner.
(WebCore::DateTimeEditElement::layout):
Remove creation code for -webkit-datetime-edit-gap and SpinButtonElement.
(WebCore::DateTimeEditElement::defaultEventHandler):
Move the code for m_spinButton to
BaseMultipleFieldsDateAndTimeInputType::forwardEvent.
(WebCore::DateTimeEditElement::hasFocusedField): A helper for
BaseMultipleFieldsDateAndTimeInputType::shouldSpinButtonRespondToWheelEvents.
(WebCore::DateTimeEditElement::stepDown): A helper for
BaseMultipleFieldsDateAndTimeInputType::spinButtonStepDown.
(WebCore::DateTimeEditElement::stepUp): A helper for
BaseMultipleFieldsDateAndTimeInputType::spinButtonStepUp.
(WebCore::DateTimeEditElement::updateUIState): Move the code to
BaseMultipleFieldsDateAndTimeInputType::disabledAttributeChanged
and readonlyAttributeChanged.

LayoutTests:

Add a pixel image which has notable changes.
Input elements in other tests have slightly small height and
slightly narrow width.

* platform/chromium-mac/fast/forms/month-multiple-fields/month-multiple-fields-appearance-l10n-expected.png:
* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move appendAsLDMLLiteral in LocaleWin.cpp to a common place
https://bugs.webkit.org/show_bug.cgi?id=100129

Reviewed by Kentaro Hara.

We're going to use appendAsLDMLLiteral in other code, and it is
related to DateTimeFormat class.  So we move it to DateTimeFormat
class as quoteAndAppendLiteral.

No new tests because of no behavior change.

* platform/text/DateTimeFormat.cpp:
(WebCore::DateTimeFormat::quoteAndAppendLiteral):
Moved from LocaleWin.cpp
* platform/text/DateTimeFormat.h:
Declare StringBuilder by wtf/Forward.h. It also declares String.
(DateTimeFormat): Declare quoteAndAppendLiteral.
* platform/text/LocaleWin.cpp:
(WebCore): Move appendLDMLLiteral to DateTimeFormat.
(WebCore::convertWindowsDateFormatToLDML):
Follow the moving.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132292 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Unreviewed EFL gardening.
https://bugs.webkit.org/show_bug.cgi?id=100125

Added pixel baselines for editing/pasteboard.

Patch by Michał Pakuła vel Rutka <m.pakula@samsung.com> on 2012-10-23

* platform/efl/editing/pasteboard: 26 new pixel baselines.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Stop using NSHomeDirectory() to get the home directory, it doesn't always return what we want
https://bugs.webkit.org/show_bug.cgi?id=100180

Reviewed by Anders Carlsson.

NSHomeDirectory() doesn't return the real home directory if the host process
is App Sandboxed, so drop down and use getpwuid_r instead.

* WebProcess/mac/WebProcessMac.mm:
(WebKit::appendReadwriteSandboxDirectory):
There is no reason anymore to try to create the directory.

(WebKit::WebProcess::initializeSandbox):
Switch to getpwuid_r.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132294 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add extra check for data() in PageSerializer.
https://bugs.webkit.org/show_bug.cgi?id=99102

Reviewed by Eric Seidel.

The image returned from imageForRenderer() does not contain the raw SVG data
so this patch adds a check for image->image()->data() before writing SVG
in PageSerializer::addImageToResources.

Covered by existing test WebPageNewSerializeTest.SVGImageDontCrash.

* page/PageSerializer.cpp:
(WebCore::PageSerializer::addImageToResources):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Coordinated Graphics: Enable threaded/IPC animations
https://bugs.webkit.org/show_bug.cgi?id=93146

Unreviewed build fix, some function names changed between review and landing.


* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
(CoreIPC::encodeTimingFunction):
(CoreIPC::decodeTimingFunction):
(CoreIPC::::encode):
* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h:
(WebCore):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
exif-orientation tests should use dumpAsText(true)
https://bugs.webkit.org/show_bug.cgi?id=100076

Reviewed by Eric Seidel.

* fast/images/exif-orientation-css.html: Use dumpAsText(true).
* fast/images/exif-orientation.html: ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132297 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r132276.
http://trac.webkit.org/changeset/132276
https://bugs.webkit.org/show_bug.cgi?id=100189

It broke the Qt-WK2 build intentionally (Requested by
Ossy_night on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-10-23

Source/WebCore:

* page/Frame.h:
* platform/graphics/GraphicsLayer.cpp:
(showGraphicsLayerTree):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::tiledBacking):
* platform/graphics/TiledBacking.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::tiledBacking):
(WebCore::GraphicsLayerCA::dumpAdditionalProperties):
* platform/graphics/ca/GraphicsLayerCA.h:
(GraphicsLayerCA):
* platform/graphics/ca/mac/TileCache.h:
* platform/graphics/ca/mac/TileCache.mm:
(WebCore::TileCache::tileCoverageRect):
(WebCore::TileCache::revalidateTiles):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTreeAsText):
* testing/Internals.cpp:
(WebCore::Internals::layerTreeAsText):
* testing/Internals.h:
* testing/Internals.idl:

Tools:

* WebKitTestRunner/PlatformWebView.h:
(PlatformWebView):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):
* WebKitTestRunner/TestController.h:
(TestController):
* WebKitTestRunner/TestInvocation.cpp:
(WTR):
(WTR::TestInvocation::invoke):
* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
(WTR::PlatformWebView::PlatformWebView):
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::PlatformWebView):
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::PlatformWebView):
* WebKitTestRunner/qt/PlatformWebViewQt.cpp:
(WTR::PlatformWebView::PlatformWebView):
* WebKitTestRunner/win/PlatformWebViewWin.cpp:
(WTR::PlatformWebView::PlatformWebView):

LayoutTests:

* platform/mac/tiled-drawing/use-tiled-drawing-expected.txt: Removed.
* platform/mac/tiled-drawing/use-tiled-drawing.html: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132298 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Flush pending GraphicsLayer changes when reattaching compositing layers if necessary
https://bugs.webkit.org/show_bug.cgi?id=100187
<rdar://problem/12546770>

Reviewed by Dan Bernstein.

Fix a regression from r131940. That revision changed RenderLayerCompositor::flushPendingLayerChanges()
to bail if the root layer is unattached, which indicates that we're in the page cache, or in a
background tab. However, that dropped the layer flush on the floor, so that any subsequent changes
to GraphicsLayerCAs would just pile up and never get flushed. This was most evident on pages
that require frequent flushing, such as those running animated GIFs.

Fix by setting a flag in flushPendingLayerChanges() if we're unattached. Consult the flag
when re-attaching the root layer, and if it's set, flush the GraphicsLayers.

Not testable because we can't test detaching and re-adding web views in DRT/WTR.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::RenderLayerCompositor): Initialize m_shouldFlushOnReattach to false.
(WebCore::RenderLayerCompositor::flushPendingLayerChanges): If the root layer attachment
is RootLayerUnattached, set the m_shouldFlushOnReattach flag before returning.
(WebCore::RenderLayerCompositor::attachRootLayer): If m_shouldFlushOnReattach, flush the layers,
saying that we're the flush root.
* rendering/RenderLayerCompositor.h:
(RenderLayerCompositor): Add m_shouldFlushOnReattach flag.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132299 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Texmap][EFL] Add AcceleratedCompositingContextEfl to the build system.
https://bugs.webkit.org/show_bug.cgi?id=88630

Patch by Hyowon Kim <hw1008.kim@samsung.com> on 2012-10-23
Reviewed by Gyuyoung Kim.

Source/WebKit:

* PlatformEfl.cmake: Add the AcceleratedCompositingContextEfl.cpp file
and INCLUDE paths for TEXTURE_MAPPER_GL.

Source/WebKit/efl:

* WebCoreSupport/AcceleratedCompositingContextEfl.cpp: Modify the #include file.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132300 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Allow tests to run with a tile cache, and optionally dump the tile cache via layerTreeAsText()
https://bugs.webkit.org/show_bug.cgi?id=100159

Patch by Simon Fraser <simon.fraser@apple.com> on 2012-10-23
Reviewed by Tim Horton.

Source/WebCore:

Add a LAYER_TREE_INCLUDES_PAGE_TILE_CACHE flag for layerTreeAsText(), and plumb it
through to GraphicsLayerCA, which dumps the TiledBacking tile coverage rect.

Test: platform/mac/tiled-drawing/use-tiled-drawing.html

* page/Frame.h:
* platform/graphics/GraphicsLayer.cpp:
(showGraphicsLayerTree):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::tiledBacking):
* platform/graphics/TiledBacking.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::tiledBacking):
(WebCore::GraphicsLayerCA::dumpAdditionalProperties):
* platform/graphics/ca/GraphicsLayerCA.h:
(GraphicsLayerCA):
* platform/graphics/ca/mac/TileCache.h:
(WebCore::TileCache::tileCoverageRect):
(TileCache):
* platform/graphics/ca/mac/TileCache.mm:
(WebCore::TileCache::computeTileCoverageRect):
(WebCore::TileCache::revalidateTiles):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTreeAsText):
* testing/Internals.cpp:
(WebCore::Internals::layerTreeAsText):
* testing/Internals.h:
* testing/Internals.idl:

Tools:

Make WebKitTestRunner use a WKView with a tile cache for tests run in a directory
whose path includes "tiled-drawing". It does this by passing around a WKDictionary
of options, and if the current PlatformWebView doesn't support those options, it will
create a new one.

* WebKitTestRunner/PlatformWebView.h:
(PlatformWebView): Add a WKDictionaryRef options dictionary argument.
(WTR::PlatformWebView::viewSupportsOptions): Returns true if the view
supports the options in the WKDictionaryRef.
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize): Call createWebViewWithOptions() with
no options in the normal case.
(WTR::TestController::createWebViewWithOptions): Moved code into this fuction
so we can call it in two places.
(WTR::TestController::ensureViewSupportsOptions): If the current view
doesn't support the given options, throw it away and makea  new one that does.
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::shouldUseTiledDrawing): Return true if the directory contains "tiled-drawing".
(WTR::updateTiledDrawingForCurrentTest): Tell the TestController to check whether
the view supports the given options. No-op for non-Mac platforms.
(WTR::TestInvocation::invoke): Call updateTiledDrawingForCurrentTest().
* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
(WTR::PlatformWebView::PlatformWebView): New constructor parameter.
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::PlatformWebView):  New constructor parameter.
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(-[TestRunnerWKView initWithFrame:contextRef:pageGroupRef:useTiledDrawing:]):
(-[TestRunnerWKView _shouldUseTiledDrawingArea]): Subclass the WKView so we can return
a custom value from this method.
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/qt/PlatformWebViewQt.cpp:
(WTR::PlatformWebView::PlatformWebView): New constructor parameter.
* WebKitTestRunner/win/PlatformWebViewWin.cpp:
(WTR::PlatformWebView::PlatformWebView): New constructor parameter.

LayoutTests:

A new test that dumps tile cache data for a large page.

* platform/mac/tiled-drawing/use-tiled-drawing-expected.txt: Added.
* platform/mac/tiled-drawing/use-tiled-drawing.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132301 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r130643): ASSERTION FAILED: result.iterator != end() below PluginDatabase::add
<http://webkit.org/b/100065>

Reviewed by Anders Carlsson.

Restore the pre-r130643 hash table size for PluginDatabase to prevent these easily reproducible
collisions. This will need a proper fix at some point.

* plugins/PluginDatabase.h:
* plugins/PluginPackage.h:
(PluginPackageHashTraits):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132302 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Shadow DOM] Needs @host rule for ShadowDOM styling
https://bugs.webkit.org/show_bug.cgi?id=88606

Reviewed by Hajime Morita.

Source/WebCore:

Implemented @host-@rules according to the shadow dom spec:
http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#host-at-rule
The design doc is:
https://docs.google.com/document/d/1P2yorchF8lci2sccr-mVSRf2dtvjKeiuyQWzCB2bEA8/edit

Test: fast/dom/shadow/athost-atrules.html

* css/CSSGrammar.y.in:
Added rules for parsing @host @-rules.
* css/CSSParser.cpp:
(WebCore::CSSParser::detectAtToken):
Added a new token "@host".
(WebCore::CSSParser::createHostRule):
Added a new method to create an @host @-rule, which is invoked from
(WebCore):
* css/CSSParser.h:
Added a declaration of the above new method: createHostRule.
* css/CSSPropertySourceData.h:
Added HOST_RULE to enum Type.
* css/RuleSet.cpp:
(WebCore::RuleData::RuleData):
Modified multiple bool arguments into one argument. Now it
uses combinations of values from enum AddRuleFlags.
(WebCore::RuleSet::addRule):
(WebCore::RuleSet::addRegionRule):
(WebCore::RuleSet::addStyleRule):
Updated according to the RuleData's change.
Modified to Invoke increaseSpecificity if the given rule is @host
@-rule.
(WebCore::RuleSet::addRulesFromSheet):
Invoked addHostRule if the given rule is @host @-rule.
* css/RuleSet.h:
(RuleData):
(WebCore::RuleData::increaseSpecificity):
Added a new method to increase selector's specificity. This method is
used to make @host @-rules' specificity larger than normal author
rules' specificity.
(RuleSet):
* css/StyleResolver.cpp:
(WebCore::makeRuleSet):
(WebCore::StyleResolver::addHostRule):
A wrapper method to invoke StyleScopeResolver::addHostRule. The method
is used to make only StyleResolver know an implementation detail about
class StyleScopeResolver.
(WebCore::StyleResolver::appendAuthorStylesheets):
Updated according to the RuleData's change.
(WebCore::StyleResolver::styleSharingCandidateMatchesHostRules):
A new method to find matched host rules when an element is given.
This method invokes
StyleScopeResolver::styleSharingCandidateMatchesHostRules to find
matched host rules.
(WebCore):
(WebCore::StyleResolver::matchHostRules):
A new method to find matched host rules when an element is given.
This method invokes StyleScopeResolver::matchHostRules to find
matched host rules.
(WebCore::StyleResolver::matchScopedAuthorRules):
Modified to invoke matchHostRules.
(WebCore::StyleResolver::locateSharedStyle):
Disable sibling style cache if the given element is a shadow host and
any @host @-rules are applied to the element.
* css/StyleResolver.h:
(WebCore::StyleResolver::ensureScopeResolver):
If no scopeResolver is created, create and return the instance.
If created, just return the instance.
(StyleResolver):
* css/StyleRule.cpp:
(WebCore::StyleRuleBase::reportMemoryUsage):
(WebCore::StyleRuleBase::destroy):
(WebCore::StyleRuleBase::copy):
(WebCore::StyleRuleBase::createCSSOMWrapper):
(WebCore::StyleRuleHost::StyleRuleHost):
Implemented class StyleRuleHost. The class is almost the same as
StyleRuleBlock except type.
(WebCore):
* css/StyleRule.h:
(WebCore::StyleRuleBase::isHostRule):
(StyleRuleHost):
(WebCore::StyleRuleHost::create):
(WebCore::StyleRuleHost::copy):
(WebCore):
* css/StyleScopeResolver.cpp:
(WebCore::StyleScopeResolver::ensureAtHostRuleSetFor):
A new method to create a new RuleSet for the given shadow root.
(WebCore):
(WebCore::StyleScopeResolver::atHostRuleSetFor):
A new private inline method to obtain @host @-rules declared in
the given shadow root.
(WebCore::StyleScopeResolver::addHostRule):
Added a new method to register @host @-rules with shadow roots.
(WebCore::StyleScopeResolver::styleSharingCandidateMatchesHostRules):
A new method to find whether any @host @-rules are applied to
the given host element.
(WebCore::StyleScopeResolver::matchHostRules):
A new method to find matched rules for the given host element.
(WebCore::StyleScopeResolver::reportMemoryUsage):
* css/StyleScopeResolver.h:
(WebCore):
(StyleScopeResolver):
* css/StyleSheetContents.cpp:
(WebCore::childRulesHaveFailedOrCanceledSubresources):

LayoutTests:

* fast/dom/shadow/athost-atrules-expected.txt: Added.
* fast/dom/shadow/athost-atrules.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Remove duplicate platform/mac entries
https://bugs.webkit.org/show_bug.cgi?id=100167

Reviewed by Dirk Pranke.

We intentionally don't run platform/mac tests in Chromium.  Remove lines
that duplicate the directory WontFix.

* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132304 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed nightly gardening, skip new failing tests.

* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132305 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Rebaseline for r132291
https://bugs.webkit.org/show_bug.cgi?id=100088

* platform/chromium-linux/fast/forms/date-multiple-fields/date-multiple-fields-appearance-basic-expected.png:
* platform/chromium-linux/fast/forms/date-multiple-fields/date-multiple-fields-appearance-l10n-expected.png:
* platform/chromium-linux/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-classes-expected.png:
* platform/chromium-linux/fast/forms/date-multiple-fields/date-multiple-fields-appearance-style-expected.png:
* platform/chromium-linux/fast/forms/month-multiple-fields/month-multiple-fields-appearance-basic-expected.png:
* platform/chromium-linux/fast/forms/month-multiple-fields/month-multiple-fields-appearance-l10n-expected.png: Added.
* platform/chromium-linux/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-classes-expected.png:
* platform/chromium-linux/fast/forms/month-multiple-fields/month-multiple-fields-appearance-style-expected.png:
* platform/chromium-linux/fast/forms/time-multiple-fields/time-multiple-fields-appearance-basic-expected.png:
* platform/chromium-linux/fast/forms/time-multiple-fields/time-multiple-fields-appearance-disabled-readonly-expected.png:
* platform/chromium-linux/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-classes-expected.png:
* platform/chromium-linux/fast/forms/time-multiple-fields/time-multiple-fields-appearance-style-expected.png:
* platform/chromium-linux/fast/forms/week-multiple-fields/week-multiple-fields-appearance-basic-expected.png:
* platform/chromium-linux/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-classes-expected.png:
* platform/chromium-linux/fast/forms/week-multiple-fields/week-multiple-fields-appearance-style-expected.png:
* platform/chromium-mac-lion/fast/forms/date-multiple-fields/date-multiple-fields-appearance-basic-expected.png:
* platform/chromium-mac-lion/fast/forms/date-multiple-fields/date-multiple-fields-appearance-l10n-expected.png:
* platform/chromium-mac-lion/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-classes-expected.png:
* platform/chromium-mac-lion/fast/forms/date-multiple-fields/date-multiple-fields-appearance-style-expected.png:
* platform/chromium-mac-lion/fast/forms/month-multiple-fields/month-multiple-fields-appearance-basic-expected.png: Added.
* platform/chromium-mac-lion/fast/forms/month-multiple-fields/month-multiple-fields-appearance-l10n-expected.png: Added.
* platform/chromium-mac-lion/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-classes-expected.png: Added.
* platform/chromium-mac-lion/fast/forms/month-multiple-fields/month-multiple-fields-appearance-style-expected.png: Added.
* platform/chromium-mac-lion/fast/forms/time-multiple-fields/time-multiple-fields-appearance-basic-expected.png:
* platform/chromium-mac-lion/fast/forms/time-multiple-fields/time-multiple-fields-appearance-disabled-readonly-expected.png:
* platform/chromium-mac-lion/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-classes-expected.png: Added.
* platform/chromium-mac-lion/fast/forms/time-multiple-fields/time-multiple-fields-appearance-style-expected.png:
* platform/chromium-mac-lion/fast/forms/week-multiple-fields/week-multiple-fields-appearance-basic-expected.png:
* platform/chromium-mac-lion/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-classes-expected.png:
* platform/chromium-mac-lion/fast/forms/week-multiple-fields/week-multiple-fields-appearance-style-expected.png:
* platform/chromium-mac-snowleopard/fast/forms/date-multiple-fields/date-multiple-fields-appearance-basic-expected.png:
* platform/chromium-mac-snowleopard/fast/forms/date-multiple-fields/date-multiple-fields-appearance-l10n-expected.png:
* platform/chromium-mac-snowleopard/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-classes-expected.png:
* platform/chromium-mac-snowleopard/fast/forms/date-multiple-fields/date-multiple-fields-appearance-style-expected.png:
* platform/chromium-mac-snowleopard/fast/forms/month-multiple-fields/month-multiple-fields-appearance-basic-expected.png:
* platform/chromium-mac-snowleopard/fast/forms/month-multiple-fields/month-multiple-fields-appearance-l10n-expected.png: Added.
* platform/chromium-mac-snowleopard/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-classes-expected.png:
* platform/chromium-mac-snowleopard/fast/forms/month-multiple-fields/month-multiple-fields-appearance-style-expected.png:
* platform/chromium-mac-snowleopard/fast/forms/time-multiple-fields/time-multiple-fields-appearance-basic-expected.png:
* platform/chromium-mac-snowleopard/fast/forms/time-multiple-fields/time-multiple-fields-appearance-disabled-readonly-expected.png:
* platform/chromium-mac-snowleopard/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-classes-expected.png:
* platform/chromium-mac-snowleopard/fast/forms/time-multiple-fields/time-multiple-fields-appearance-style-expected.png:
* platform/chromium-mac-snowleopard/fast/forms/week-multiple-fields/week-multiple-fields-appearance-basic-expected.png:
* platform/chromium-mac-snowleopard/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-classes-expected.png:
* platform/chromium-mac-snowleopard/fast/forms/week-multiple-fields/week-multiple-fields-appearance-style-expected.png:
* platform/chromium-mac/fast/forms/date-multiple-fields/date-multiple-fields-appearance-basic-expected.png:
* platform/chromium-mac/fast/forms/date-multiple-fields/date-multiple-fields-appearance-l10n-expected.png:
* platform/chromium-mac/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-classes-expected.png:
* platform/chromium-mac/fast/forms/date-multiple-fields/date-multiple-fields-appearance-style-expected.png:
* platform/chromium-mac/fast/forms/month-multiple-fields/month-multiple-fields-appearance-basic-expected.png:
* platform/chromium-mac/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-classes-expected.png:
* platform/chromium-mac/fast/forms/month-multiple-fields/month-multiple-fields-appearance-style-expected.png:
* platform/chromium-mac/fast/forms/time-multiple-fields/time-multiple-fields-appearance-basic-expected.png:
* platform/chromium-mac/fast/forms/time-multiple-fields/time-multiple-fields-appearance-disabled-readonly-expected.png:
* platform/chromium-mac/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-classes-expected.png:
* platform/chromium-mac/fast/forms/time-multiple-fields/time-multiple-fields-appearance-style-expected.png:
* platform/chromium-mac/fast/forms/week-multiple-fields/week-multiple-fields-appearance-basic-expected.png:
* platform/chromium-mac/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-classes-expected.png:
* platform/chromium-mac/fast/forms/week-multiple-fields/week-multiple-fields-appearance-style-expected.png:
* platform/chromium-win-xp/fast/forms/date-multiple-fields/date-multiple-fields-appearance-l10n-expected.png:
* platform/chromium-win-xp/fast/forms/month-multiple-fields/month-multiple-fields-appearance-l10n-expected.png: Added.
* platform/chromium-win/fast/forms/date-multiple-fields/date-multiple-fields-appearance-basic-expected.png:
* platform/chromium-win/fast/forms/date-multiple-fields/date-multiple-fields-appearance-l10n-expected.png:
* platform/chromium-win/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-classes-expected.png:
* platform/chromium-win/fast/forms/date-multiple-fields/date-multiple-fields-appearance-style-expected.png:
* platform/chromium-win/fast/forms/month-multiple-fields/month-multiple-fields-appearance-basic-expected.png:
* platform/chromium-win/fast/forms/month-multiple-fields/month-multiple-fields-appearance-l10n-expected.png: Added.
* platform/chromium-win/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-classes-expected.png:
* platform/chromium-win/fast/forms/month-multiple-fields/month-multiple-fields-appearance-style-expected.png:
* platform/chromium-win/fast/forms/time-multiple-fields/time-multiple-fields-appearance-basic-expected.png:
* platform/chromium-win/fast/forms/time-multiple-fields/time-multiple-fields-appearance-disabled-readonly-expected.png:
* platform/chromium-win/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-classes-expected.png:
* platform/chromium-win/fast/forms/time-multiple-fields/time-multiple-fields-appearance-style-expected.png:
* platform/chromium-win/fast/forms/week-multiple-fields/week-multiple-fields-appearance-basic-expected.png:
* platform/chromium-win/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-classes-expected.png:
* platform/chromium-win/fast/forms/week-multiple-fields/week-multiple-fields-appearance-style-expected.png:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132306 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CodeBlock: Give m_putToBaseOperations an inline capacity.
<http://webkit.org/b/100190>
<rdar://problem/12562466>

Reviewed by Oliver Hunt.

Since the CodeBlock constructor always inserts a single PutToBaseOperation, but there's no
guarantee that more will follow, give the m_putToBaseOperations vector an inline capacity of 1.
There are 4009 of these Vectors on Membuster3, and only 126 of them have more than a single entry.

This change yields a 1.90MB reduction in memory usage.

* bytecode/CodeBlock.h:
(CodeBlock):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132307 268f45cc-cd09-0410-ab3c-d52691b4dbfc
The font cache evicts inactive font data too aggressively when not under memory pressure
https://bugs.webkit.org/show_bug.cgi?id=100194

Reviewed by Sam Weinig.

Increasing the number of inactive font data objects the cache may hold increases the hit
rate, leading to improved page load performance. When memory pressure is detected,
MemoryPressureHandler evicts all inactive objects, regardless of the limits we are
increasing here.

* platform/graphics/FontCache.cpp:
(WebCore): Increased the maximum number of inactive font data objects in the cache from 50
to 225, and the number of objects to evict once the limit is met from 20 to 25.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132308 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/mac: WebKit/mac part of <rdar://problem/2966974> [mac] Kerning and ligatures are not enabled by default
https://bugs.webkit.org/show_bug.cgi?id=100188

Reviewed by Sam Weinig.

* WebView/WebView.mm:
(+[WebView initialize]): Added a local variable to hold the standard user defaults. Added
code to register a value of YES for the WebKitKerningAndLigaturesEnabledByDefault user
default. Changed to refer to that default key by name.

Source/WebKit2: WebKit2 part of <rdar://problem/2966974> [mac] Kerning and ligatures are not enabled by default
https://bugs.webkit.org/show_bug.cgi?id=100188

Reviewed by Sam Weinig.

* UIProcess/mac/WebContextMac.mm:
(WebKit::registerUserDefaultsIfNeeded): Added. Registers a value of YES for the
WebKitKerningAndLigaturesEnabledByDefault user default if it has not been registered yet.
(WebKit::WebContext::platformInitializeWebProcess): Added a call to
registerUserDefaultsIfNeeded, and changed to refer to the defaults key by name.

Tools: Tools changes for <rdar://problem/2966974> [mac] Kerning and ligatures are not enabled by default
https://bugs.webkit.org/show_bug.cgi?id=100188

Reviewed by Sam Weinig.

Disable kerning and ligatures by default when running the tests.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetDefaultsToConsistentValues): Set a value of NO for the
WebKitKerningAndLigaturesEnabledByDefault user default.
* WebKitTestRunner/mac/main.mm:
(main): Register a value of NO for the WebKitKerningAndLigaturesEnabledByDefault user
default.



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