Move inline style logic from ElementAttributeData to StyledElement.
<http://webkit.org/b/102120>

Reviewed by Antti Koivisto.

Source/WebCore:

Move all the logic dealing with element inline style from ElementAttributeData to StyledElement.
No difference in behavior, just making ElementAttributeData dumber.

* css/StylePropertySet.cpp:
* css/StylePropertySet.h:
(WebCore::StylePropertySet::hasCSSOMWrapper):
(WebCore::StylePropertySet::cssStyleDeclaration):

    Added as complements to ensureCSSStyleDeclaration() for the case where we don't want
    to instantiate a CSSOM wrapper unnecessarily.

* dom/StyledElement.h:
(WebCore::StyledElement::inlineStyle):
* dom/ElementAttributeData.cpp:
(WebCore::ImmutableElementAttributeData::ImmutableElementAttributeData):
(WebCore::MutableElementAttributeData::MutableElementAttributeData):
(WebCore::ElementAttributeData::reportMemoryUsage):
* dom/ElementAttributeData.h:
(WebCore::ElementAttributeData::inlineStyle):
(ElementAttributeData):

    Renamed m_inlineStyleDecl to m_inlineStyle. Finally.

* dom/StyledElement.cpp:
(WebCore::StyledElement::~StyledElement):

    Detach the CSSOM wrapper from the inline style if there is one.

(WebCore::StyledElement::ensureMutableInlineStyle):
(WebCore::StyledElement::style):

    Renamed ensureInlineStyle() to ensureMutableInlineStyle() since that's what it
    actually does. Update call sites accordingly.

(WebCore::StyledElement::inlineStyleCSSOMWrapper):

    Added helper to get the CSSOM wrapper for the element's inline style if there is one.

(WebCore::StyledElement::styleAttributeChanged):

    Do the work to parse/update/replace the inline style attribute here instead of
    in an ElementAttributeData method.

(WebCore::StyledElement::setInlineStyleProperty):
(WebCore::StyledElement::removeInlineStyleProperty):
(WebCore::StyledElement::removeAllInlineStyleProperties):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
(WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
(WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::handleStyleSpans):
* html/canvas/CanvasStyle.cpp:
(WebCore::currentColor):

    s/ensureInlineStyle/ensureMutableInlineStyle/

Source/WebKit/qt:

* Api/qwebelement.cpp:
(QWebElement::styleProperty):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134539 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Add a button parameter to mouseClick, mouseDown, mouseUp functions
https://bugs.webkit.org/show_bug.cgi?id=102065

Reviewed by Laszlo Gombos.

mouseClick(), mouseDown() and mouseUp() test functions are only able to test a left button of mouse now.
However, EFL API test framwork needs to test various mouse buttons. For example, context menu test needs
to simulate a right mouse button. So, button type parameter needs to be added for it.

* UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:
(EWK2UnitTest::EWK2UnitTestBase::mouseClick):
(EWK2UnitTest::EWK2UnitTestBase::mouseDown):
(EWK2UnitTest::EWK2UnitTestBase::mouseUp):
* UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
(EWK2UnitTestBase):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134540 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Collect necessary features for SelectRuleFeatureSet
https://bugs.webkit.org/show_bug.cgi?id=102160

Reviewed by Dimitri Glazkov.

Source/WebCore:

When pseudo class is changed, we might have to invalidate distribution. To determine whether we should invalidate
distribution, we would like to collect RuleFeature from select attributes.

According to ShadowDOM spec, we have to collect the following pseudo classes: checked, enabled, disabled,
indeterminate, link, target, and visited. We collect them in this patch.

Test: fast/dom/shadow/shadow-select-attribute-featureset.html

* html/shadow/SelectRuleFeatureSet.cpp:
(WebCore::SelectRuleFeatureSet::SelectRuleFeatureSet): Uses int as bitset so that we can use bit operator.
(WebCore::SelectRuleFeatureSet::add):
(WebCore::SelectRuleFeatureSet::clear):
(WebCore::SelectRuleFeatureSet::collectFeaturesFromSelector): Collects necessary features from CSSSelector.
* html/shadow/SelectRuleFeatureSet.h:
(WebCore::SelectRuleFeatureSet::hasSelectorForChecked):
(WebCore::SelectRuleFeatureSet::hasSelectorForEnabled):
(WebCore::SelectRuleFeatureSet::hasSelectorForDisabled):
(WebCore::SelectRuleFeatureSet::hasSelectorForIndeterminate):
(WebCore::SelectRuleFeatureSet::hasSelectorForLink):
(WebCore::SelectRuleFeatureSet::hasSelectorForTarget):
(WebCore::SelectRuleFeatureSet::hasSelectorForVisited):
(SelectRuleFeatureSet):
(WebCore::SelectRuleFeatureSet::setSelectRuleFeature):
(WebCore::SelectRuleFeatureSet::hasSelectorFor):
* testing/Internals.cpp:
(WebCore::Internals::hasSelectorForPseudoClassInShadow):
(WebCore):
* testing/Internals.h:
(Internals):
* testing/Internals.idl:

LayoutTests:

* fast/dom/shadow/shadow-select-attribute-featureset-expected.txt:
* fast/dom/shadow/shadow-select-attribute-featureset.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134541 268f45cc-cd09-0410-ab3c-d52691b4dbfc
checkbox to toggle FPS counter in the inspector's settings
https://bugs.webkit.org/show_bug.cgi?id=99660

Patch by Eberhard Graether <egraether@google.com> on 2012-11-13
Reviewed by Pavel Feldman.

Added a checkbox to the inspector's settings to toggle a FPS counter. The checkbox appears when InspectorClient::canShowFPSCounter() returns true.

Source/Platform:

* chromium/public/WebLayerTreeView.h:
(WebLayerTreeView):
(WebKit::WebLayerTreeView::setShowFPSCounter):

Source/WebCore:

No new tests.

* English.lproj/localizedStrings.js:
* inspector/Inspector.json:
* inspector/InspectorClient.h:
(WebCore::InspectorClient::canShowFPSCounter):
(WebCore::InspectorClient::setShowFPSCounter):
(InspectorClient):
* inspector/InspectorPageAgent.cpp:
(PageAgentState):
(WebCore::InspectorPageAgent::enable):
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::canShowFPSCounter):
(WebCore):
(WebCore::InspectorPageAgent::setShowFPSCounter):
* inspector/InspectorPageAgent.h:
* inspector/front-end/Settings.js:
* inspector/front-end/SettingsScreen.js:
(WebInspector.GenericSettingsTab):
(WebInspector.GenericSettingsTab.prototype.get _showFPSCounterChanged):
* inspector/front-end/inspector.js:
(WebInspector.doLoadedDone):

Source/WebKit/chromium:

* public/WebView.h:
(WebView):
* src/InspectorClientImpl.cpp:
(WebKit::InspectorClientImpl::canShowFPSCounter):
(WebKit):
(WebKit::InspectorClientImpl::setShowFPSCounter):
* src/InspectorClientImpl.h:
(InspectorClientImpl):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::setShowFPSCounter):
(WebKit):
(WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
(WebKit::WebViewImpl::loadFontAtlasIfNecessary):
* src/WebViewImpl.h:
(WebViewImpl):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134542 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Enable datalist UI for input types week and month
https://bugs.webkit.org/show_bug.cgi?id=102041

Reviewed by Kent Tamura.

Source/WebCore:

Enabling datalist UI for input types week and month.

No new tests. Tests will be added later in Bug 102039 and Bug 102040.

* rendering/RenderThemeChromiumCommon.cpp:
(WebCore::RenderThemeChromiumCommon::supportsDataListUI): Add month and week to the list.

Source/WebKit/chromium:

* src/DateTimeChooserImpl.cpp:
(WebKit::DateTimeChooserImpl::writeDocument): If the type supports calendar picker show the "Other..." option.

LayoutTests:

* platform/chromium/fast/forms/datalist/input-list-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134543 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix compile warning [-Wsign-compare]
https://bugs.webkit.org/show_bug.cgi?id=101458

Patch by KyungTae Kim <ktf.kim@samsung.com> on 2012-11-13
Reviewed by Alexey Proskuryakov.

Currently, lossy check has been done by comparing file size(posix signed integral value) with conversioned(standard c++ unsigned integral value).
However, it leads -Wsign-compare compile warning.
Therefore, this patch assigns the file size to the biggest possible unsigned variable, then does the lossy check.

* platform/posix/SharedBufferPOSIX.cpp:
(WebCore::SharedBuffer::createWithContentsOfFile):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134544 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r134524.
http://trac.webkit.org/changeset/134524
https://bugs.webkit.org/show_bug.cgi?id=102177

"Chromiium build broken" (Requested by haraken on #webkit).

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

* WebCore.gyp/WebCore.gyp:
* WebCore.gypi:
* rendering/RenderThemeChromiumFontProvider.cpp: Removed.
* rendering/RenderThemeChromiumFontProvider.h: Removed.
* rendering/RenderThemeChromiumFontProviderLinux.cpp: Removed.
* rendering/RenderThemeChromiumFontProviderWin.cpp: Removed.
* rendering/RenderThemeChromiumSkia.cpp:
(WebCore::RenderThemeChromiumSkia::defaultGUIFont):
(WebCore::RenderThemeChromiumSkia::systemFont):
(WebCore::RenderThemeChromiumSkia::setDefaultFontSize):
* rendering/RenderThemeChromiumSkia.h:
(RenderThemeChromiumSkia):
* rendering/RenderThemeChromiumWin.cpp:
(WebCore):
(WebCore::getNonClientMetrics):
(WebCore::systemFontSize):
(WebCore::pointsToPixels):
(WebCore::RenderThemeChromiumWin::systemFont):
(WebCore::RenderThemeChromiumWin::setDefaultFontSize):
* rendering/RenderThemeChromiumWin.h:
(RenderThemeChromiumWin):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134545 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Enable calendar picker for input types datetime/datetime-local
https://bugs.webkit.org/show_bug.cgi?id=101889

Patch by Kunihiko Sakamoto <ksakamoto@chromium.org> on 2012-11-13
Reviewed by Kent Tamura.

Source/WebCore:

This adds calendar picker to <input type=datetime> and <input type=datetime-local>.
When a user choose a date from calendar picker, year/month/day fields of the input
element are updated and hour/minute/second fields are unchanged.

Tests: platform/chromium/fast/forms/calendar-picker/calendar-picker-datetime-local.html
       platform/chromium/fast/forms/calendar-picker/calendar-picker-datetime.html

* Resources/pagepopups/calendarPicker.js: Day.parse accepts datetime string (just drops time part).
* html/BaseMultipleFieldsDateAndTimeInputType.cpp:
(WebCore::BaseMultipleFieldsDateAndTimeInputType::pickerIndicatorChooseValue):
If the given value is not valid for the element, try to parse it as a date string.
* html/DateTimeInputType.cpp:
(WebCore::DateTimeInputType::formatDateTimeFieldsState): DateTimeFieldsState::month() returns 1-12, not 0-11.
* html/DateTimeLocalInputType.cpp:
(WebCore::DateTimeLocalInputType::formatDateTimeFieldsState): Ditto.
* html/shadow/DateTimeEditElement.cpp:
(WebCore::DateTimeEditElement::setOnlyYearMonthDay): Added.
(WebCore):
* html/shadow/DateTimeEditElement.h:
(DateTimeEditElement):
* rendering/RenderThemeChromiumCommon.cpp:
(WebCore::RenderThemeChromiumCommon::supportsCalendarPicker): Return true for datetime and datetimelocal too.

LayoutTests:

Added tests for calendar picker for inpt type=datetime/datetime-local.

* platform/chromium/fast/forms/calendar-picker/calendar-picker-datetime-expected.txt: Added.
* platform/chromium/fast/forms/calendar-picker/calendar-picker-datetime.html: Added.
* platform/chromium/fast/forms/calendar-picker/calendar-picker-datetimelocal-expected.txt: Added.
* platform/chromium/fast/forms/calendar-picker/calendar-picker-datetimelocal.html: Added.

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