RenderStyle: Pack Color members tighter in substructures.
<http://webkit.org/b/101860>

Patch by Andreas Kling <kling@webkit.org> on 2012-11-12
Reviewed by Antti Koivisto.

For RenderStyle substructures (StyleInheritedData, et al.), unfold all WebCore::Color
members into RGBA32/bool variables OR just an RGBA32 if the color can never be invalid.

Memory saved per instance:

    - StyleMultiColData:          4 bytes
    - StyleBackgroundData:        8 bytes
    - StyleInheritedData:         8 bytes
    - StyleRareInheritedData:    24 bytes
    - StyleRareNonInheritedData: 24 bytes

323kB progression on Membuster3.

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::diff):
(WebCore::RenderStyle::setColor):
(WebCore::RenderStyle::setVisitedLinkColor):
(WebCore::RenderStyle::setVisitedLinkColumnRuleColor):
(WebCore::RenderStyle::setBackgroundColor):
* rendering/style/RenderStyle.h:
* rendering/style/StyleBackgroundData.cpp:
(WebCore::StyleBackgroundData::StyleBackgroundData):
* rendering/style/StyleBackgroundData.h:
(WebCore::StyleBackgroundData::color):
(StyleBackgroundData):
* rendering/style/StyleInheritedData.cpp:
(WebCore::StyleInheritedData::StyleInheritedData):
* rendering/style/StyleInheritedData.h:
(StyleInheritedData):
* rendering/style/StyleMultiColData.cpp:
(WebCore::StyleMultiColData::StyleMultiColData):
(WebCore::StyleMultiColData::setVisitedLinkColumnRuleColor):
* rendering/style/StyleMultiColData.h:
(StyleMultiColData):
(WebCore::StyleMultiColData::visitedLinkColumnRuleColor):
* rendering/style/StyleRareInheritedData.cpp:
(SameSizeAsStyleRareInheritedData):
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):
(WebCore::StyleRareInheritedData::setTextStrokeColor):
(WebCore::StyleRareInheritedData::setTextFillColor):
(WebCore::StyleRareInheritedData::setTextEmphasisColor):
(WebCore::StyleRareInheritedData::setVisitedLinkTextStrokeColor):
(WebCore::StyleRareInheritedData::setVisitedLinkTextFillColor):
(WebCore::StyleRareInheritedData::setVisitedLinkTextEmphasisColor):
* rendering/style/StyleRareInheritedData.h:
(StyleRareInheritedData):
(WebCore::StyleRareInheritedData::textStrokeColor):
(WebCore::StyleRareInheritedData::textFillColor):
(WebCore::StyleRareInheritedData::textEmphasisColor):
(WebCore::StyleRareInheritedData::visitedLinkTextStrokeColor):
(WebCore::StyleRareInheritedData::visitedLinkTextFillColor):
(WebCore::StyleRareInheritedData::visitedLinkTextEmphasisColor):
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
(WebCore::StyleRareNonInheritedData::setVisitedLinkBorderLeftColor):
(WebCore::StyleRareNonInheritedData::setVisitedLinkBorderRightColor):
(WebCore::StyleRareNonInheritedData::setVisitedLinkBorderTopColor):
(WebCore::StyleRareNonInheritedData::setVisitedLinkBorderBottomColor):
(WebCore::StyleRareNonInheritedData::setVisitedLinkOutlineColor):
(WebCore::StyleRareNonInheritedData::setVisitedLinkBackgroundColor):
* rendering/style/StyleRareNonInheritedData.h:
(WebCore::StyleRareNonInheritedData::visitedLinkBackgroundColor):
(WebCore::StyleRareNonInheritedData::visitedLinkOutlineColor):
(WebCore::StyleRareNonInheritedData::visitedLinkBorderLeftColor):
(WebCore::StyleRareNonInheritedData::visitedLinkBorderRightColor):
(WebCore::StyleRareNonInheritedData::visitedLinkBorderTopColor):
(WebCore::StyleRareNonInheritedData::visitedLinkBorderBottomColor):
(StyleRareNonInheritedData):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134224 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8][JSC] HTMLElement::itemValue() needs not to be custom
https://bugs.webkit.org/show_bug.cgi?id=101882

Reviewed by Adam Barth.

We can remove a [Custom] IDL attribute.

No tests. No change in behavior.

* bindings/js/JSHTMLElementCustom.cpp:
* bindings/v8/custom/V8HTMLElementCustom.cpp:
* html/HTMLElement.idl:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134225 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] REGRESSION(r134205): gardening. Skipped 2 failing reftests.
https://bugs.webkit.org/show_bug.cgi?id=101933

Patch by János Badics <jbadics@inf.u-szeged.hu> on 2012-11-12
Reviewed by Csaba Osztrogonác.

* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134226 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Update BB10 form theme.
https://bugs.webkit.org/show_bug.cgi?id=100760

Patch by Tiancheng Jiang <tijiang@rim.com> on 2012-11-12
Reviewed by Rob Buis.

RIM PR 236993
Internally Reviewed by Jeff Rogers.
Enable GL slider.

* platform/blackberry/RenderThemeBlackBerry.cpp:
(WebCore::drawThreeSlice):
(WebCore):
(WebCore::RenderThemeBlackBerry::paintSliderTrackRect):
(WebCore::RenderThemeBlackBerry::paintSliderThumb):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Fix tst_QWebPage::inputMethods on Qt5
https://bugs.webkit.org/show_bug.cgi?id=101571

Reviewed by Simon Hausmann.

QEvent::RequestSoftwareInputPanel isn't passed through event filters anymore.
Use QInputMethodPrivate::testContext instead to capture input method events,
the same way as qtbase tests like tst_QTextEdit are doing.

* tests/qwebpage/tst_qwebpage.cpp:
(TestInputContext::TestInputContext):
(TestInputContext::~TestInputContext):
(TestInputContext):
(TestInputContext::showInputPanel):
(TestInputContext::hideInputPanel):
(TestInputContext::isInputPanelVisible):
(tst_QWebPage::inputMethods):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134228 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Fix a crash in tst_QWebInspector::attachAndDestroy
https://bugs.webkit.org/show_bug.cgi?id=101575

Reviewed by Simon Hausmann.

It can now happen that destroyInspectorView is called when the Page
is destroyed. This would call getOrCreateInspector and re-create a
QWebInspector.

Since the new instance is created after our setInspector(0) cleanup
in ~QWebPagePrivate, this runs into the same crash that this line was
protecting us against.

* WebCoreSupport/InspectorClientQt.cpp:
(WebCore::InspectorFrontendClientQt::destroyInspectorView):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134229 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Fix URL issues in tst_qwebframe
https://bugs.webkit.org/show_bug.cgi?id=101741

Reviewed by Simon Hausmann.

* tests/qwebframe/tst_qwebframe.cpp:
(FakeReply::FakeReply):
Properly forward the request URL to our custom reply.
This would cause redirections not to occur. The requestedUrl and setUrlSameUrl tests
would fail because of this.

(tst_QWebFrame::setUrlToInvalid):
- http:/example.com is a valid URL, but not a valid HTTP URL, so remove this check.
- QCOMPARE uses testlib's toString on the QUrls to compare them and it now
also output the error description. Since we want to compare the resulting
URL instead, compare their toEncoded() value.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134230 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Appending "!important" to the property value of QWebElement::setStyleProperty isn't working
https://bugs.webkit.org/show_bug.cgi?id=101763

Reviewed by Kenneth Rohde Christiansen.

In the pastWebCore have been considering the important token of a CSS
property value if it was followed by !important as well as the
important parameter of setInlineStyleProperty, but not anymore.

Since we need to keep the behavior compatible, do the parsing of the
value and extract the token if present. Ideally this would be passed
as a parameter to the function but I think it's not worth deprecating
the old mechanism.
The parsing is pretty dumb, so this will break applications that
passed a value with spaces between the "!" and "important".

This fixes part of tst_QWebElement::style

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] tst_QWebElement::style() fails because QWebElement::CascadedStyle doesn't work as expected
https://bugs.webkit.org/show_bug.cgi?id=65244

Reviewed by Kenneth Rohde Christiansen.

StyleResolver::styleRulesForElement now takes flags as parameter instead of a bool to specify
that we want to exclude UI and user style sheets.

* Api/qwebelement.cpp:
(QWebElement::styleProperty):
* tests/qwebelement/tst_qwebelement.cpp:
(tst_QWebElement::style):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134232 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] tst_QWebElement::style() fails because QWebElement::InlineStyle now works as expected
https://bugs.webkit.org/show_bug.cgi?id=60372

Reviewed by Simon Hausmann.

Update the expected value to follow this comment in StylePropertySet::addParsedProperty:
"Only add properties that have no !important counterpart present"

* tests/qwebelement/tst_qwebelement.cpp:
(tst_QWebElement::style):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134233 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Fix tst_QWebPage::showModalDialog() API test
https://bugs.webkit.org/show_bug.cgi?id=63244

Reviewed by Simon Hausmann.

* tests/qwebpage/tst_qwebpage.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134234 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Fix tst_QWebPage::inputMethods

Reviewed by Simon Hausmann.

Details of the failure:
FAIL!  : tst_QWebPage::inputMethods(QWebView) Compared values are not the same
   Actual (page->settings()->fontFamily(QWebSettings::SerifFont)): FooSerifFont
   Expected (font.family()): Helvetica
   Loc: [Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp(1691)]

The issue was that WebCore wouldn't find FooSerifFont and would have
RenderStyle::font() return the fallback font it used instead.

* tests/qwebpage/tst_qwebpage.cpp:
(tst_QWebPage::inputMethods):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134235 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Fix tst_QObjectBridge::callQtInvokable

Reviewed by Simon Hausmann.

Q_DECLARE_METATYPE now calls qRegisterMetaType so just prevent
the value from being wrapped by QVariant since this code shouldn't
be reached anyway.

* tests/qobjectbridge/tst_qobjectbridge.cpp:
(MyQObject::myInvokableWithBrushStyleArg):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134236 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Fix tst_QWebPage::testLocalStorageVisibility

Reviewed by Simon Hausmann.

window.localStorage is expected to work for file URLs.
I'm not sure why it did work when this test was written,
but I believe that it had the wrong expected value.

* tests/qwebpage/tst_qwebpage.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134237 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Fix tst_QWebPage::findText

Reviewed by Simon Hausmann.

Details of the failure:
FAIL!  : tst_QWebPage::findText() Compared values are not the same
   Actual   (m_page->selectedHtml().trimmed().replace(regExp, "")): <span>foo</span>
   Expected (subString): foo
   Loc: [/home/joce/dev/webkit/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp(2964)]

The format returned by selectedHtml changed.
Make the test a bit more robust by just checking that the HTML
contains our search value.

* tests/qwebpage/tst_qwebpage.cpp:
(tst_QWebPage::findText):

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