Move PagePopupClient helper functions so they can be shared
https://bugs.webkit.org/show_bug.cgi?id=92096

Reviewed by Kent Tamura.

Move PagePopupClient helper functions to a separate file,
so they can be shared with new PagePopupClients.

No new tests. Covered by fast/forms/date/calendar-picker-appearance.html

* WebCore.gypi: Added PagePopupClient.cpp
* html/shadow/CalendarPickerElement.cpp:
(WebCore::CalendarPickerElement::writeDocument): Modified to use PagePopupClient.
* page/PagePopupClient.cpp: Added.
(WebCore):
(WebCore::PagePopupClient::addJavaScriptString):
(WebCore::PagePopupClient::addProperty):
* page/PagePopupClient.h:
(WebCore::PagePopupClient::addString):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123568 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: fix #include dependencies so IDBRequest isn't an include root
https://bugs.webkit.org/show_bug.cgi?id=92167

Patch by Alec Flett <alecflett@chromium.org> on 2012-07-24
Reviewed by Tony Chang.

Source/WebCore:

Remove implicit dependencies due to using IDBRequest.h, and fix all
places that break as a result.

* Modules/indexeddb/IDBCallbacks.h:
(WebCore):
* Modules/indexeddb/IDBObjectStore.cpp:
* Modules/indexeddb/IDBRequest.h:
* inspector/InspectorIndexedDBAgent.cpp:

Source/WebKit/chromium:

Remove implicit dependencies due to using IDBRequest.h, and fix all
places that break as a result.

* src/IDBCallbacksProxy.cpp:
* src/WebIDBDatabaseImpl.cpp:
* src/WebIDBTransactionImpl.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123569 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=89179
Rendering LI having Shadow DOM seems weird

Reviewed by Dimitri Glazkov.

Source/WebCore:

This incorrect rendering happend because HTMLLIElement::attach()
wasn't aware of composed shadow subtree. This change makes it
aware of that using ComposedShadowTreeParentWalker.

Test: fast/dom/shadow/shadow-and-list-elements.html

* html/HTMLLIElement.cpp:
(WebCore::HTMLLIElement::attach):

LayoutTests:

* fast/dom/shadow/shadow-and-list-elements-expected.html: Added.
* fast/dom/shadow/shadow-and-list-elements.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123570 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderBlock::positionForPoint can fail when the block or its children have a vertical writing mode
https://bugs.webkit.org/show_bug.cgi?id=92202

Reviewed by Beth Dakin.

Source/WebCore: 

Test: fast/writing-mode/positionForPoint.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::positionForPoint): Fixed two issues, each of which are covered by
one of the sub-tests in the new regression test: (1) changed to compare children’s logical
bounds against pointInLogicalContents, i.e. compare childern’s horizontal bounds to the
point’s horizontal component; and (2) changed to use logicalTopForChild and
logicalHeightForChild, which account for this block’s writing mode, instead of logicalTop
and logicalBottom, which are based on the child’s writing mode.

LayoutTests: 

* fast/writing-mode/positionForPoint-expected.txt: Added.
* fast/writing-mode/positionForPoint.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123571 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Avoid moving child objects multiple times when vertical scrollbar are shown at the left side.
https://bugs.webkit.org/show_bug.cgi?id=91756

Reviewed by Tony Chang.

Source/WebCore:

My r123067 moves the top-left origin of an RTL element right when its vertical
scrollbar is shown at its left side. (That is, r123067 moves all child objects
in the RTL element right.) This change also increases RenderBox::clientLeft()
at the same time, i.e. it also moves child objects right. Furthermore, my r109512
moves positioned objects in an RTL element right at the same time. This makes
WebKit move objects in an RTL element up to three times by the scrollbar width.
(Moving an absolute object right increases the scrollWidth value and it causes
this bug.) This change removes unnecessary code that moves objects right in my
r109512 and RenderBox::clientLeft().

Test: scrollbars/rtl/div-absolute.html
      fast/block/float/026.html
      fast/block/float/028.html
      fast/overflow/unreachable-overflow-rtl-bug.html

* dom/Element.cpp:
(WebCore::Element::clientLeft): Increase clientLeft value by the width of a vertical scrollbar as written in the CSSOM specification.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addOverflowFromPositionedObjects): Removed unnecessary code.
(WebCore::RenderBlock::determineLogicalLeftPositionForChild): Removed unnecessary code.
* rendering/RenderBox.h:
(WebCore::RenderBox::clientLeft): Removed unnecessary code.

LayoutTests:

This change adds a test that compares CSSOM properties of an RTL element which
includes positioned objects with the CSSOM properties of an LTR one. This change
also uses clientLeft properties in offsetX-offsetY.html to remove a hard-coded
value in the test and adds rebaselined results for Windows.

* fast/events/offsetX-offsetY.html: Replaced a hard-coded value 'borderLeft' with clientLeft.
* platform/chromium-linux/fast/block/float/026-expected.png:
* platform/chromium-linux/fast/block/float/028-expected.png:
* platform/chromium-win/fast/block/float/026-expected.png:
* platform/chromium-win/fast/block/float/028-expected.png:
* platform/chromium-win/fast/overflow/unreachable-overflow-rtl-bug-expected.png:
* platform/chromium-win/fast/overflow/unreachable-overflow-rtl-bug-expected.txt:
* scrollbars/rtl/div-absolute-expected.txt: Added.
* scrollbars/rtl/div-absolute.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123572 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Tests] Remove duplicated fast/forms/number/number-spinbutton-events.html
https://bugs.webkit.org/show_bug.cgi?id=92205

Reviewed by Kent Tamura.

This patch removes fast/forms/number/number-spinbutton-events.html
because fast/forms/number/number-events.html covers and checked more.

r108955 is an evidence of coverage.

* fast/forms/number/number-spinbutton-events-expected.txt: Removed.
* fast/forms/number/number-spinbutton-events.html: Removed.
* platform/efl/Skipped:
* platform/qt-arm/TestExpectations:
* platform/win/Skipped:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123573 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Move renderingStats from WebView to WebWidget.
https://bugs.webkit.org/show_bug.cgi?id=92184

Patch by Dave Tu <dtu@chromium.org> on 2012-07-24
Reviewed by Adam Barth.

We are going to add some rendering stats that work in non-composited mode, so the renderingStats() method should be moved from WebView to WebWidget.

* public/WebView.h:
(WebKit):
(WebView):
* public/WebWidget.h:
(WebKit):
(WebWidget):
(WebKit::WebWidget::renderingStats):
* src/WebViewImpl.h:
(WebViewImpl):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123574 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Tests] Rename fast/number/number-events.html to number-spinbutton-change-and-input-events.html
https://bugs.webkit.org/show_bug.cgi?id=92208

Reviewed by Kent Tamura.

This patch renames fast/forms/number/number-events.html to number-spinbutton-change-and-input-events.html
to make file name explains what test will be done.

* fast/forms/number/number-events-expected.txt: Removed.
* fast/forms/number/number-events.html: Removed.
* fast/forms/number/number-spinbutton-change-and-input-events-expected.txt: Copied from LayoutTests/fast/forms/number/number-events-expected.txt.
* fast/forms/number/number-spinbutton-change-and-input-events.html: Copied from LayoutTests/fast/forms/number/number-events.html.
* platform/qt/Skipped:
* platform/win/Skipped:
* platform/wincairo/Skipped:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123575 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed.  Rolled DEPS.

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

* DEPS:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123576 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Read tag names and attributes from the saved tokens where possible.
https://bugs.webkit.org/show_bug.cgi?id=92079

Reviewed by Adam Barth.

Read tag names and attributes from the saved tokens, not from the DOM.
Also added convenient methods such as hasLocalName, hasTagName, localName,
isElementNode and isDocumentFragmentNode to HTMLStackItem class.

No new tests, covered by existing tests.

* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLNames::hasImpliedEndTag):
(WebCore::HTMLNames::causesFosterParenting):
(WebCore::HTMLConstructionSite::generateImpliedEndTagsWithExclusion):
(WebCore::HTMLConstructionSite::generateImpliedEndTags):
(WebCore::HTMLConstructionSite::shouldFosterParent):
* html/parser/HTMLConstructionSite.h:
(WebCore::HTMLConstructionSite::currentStackItem):
* html/parser/HTMLElementStack.cpp:
(WebCore::HTMLNames::isNumberedHeaderElement):
(WebCore::HTMLNames::isRootNode):
(WebCore::HTMLNames::isScopeMarker):
(WebCore::HTMLNames::isListItemScopeMarker):
(WebCore::HTMLNames::isTableScopeMarker):
(WebCore::HTMLNames::isTableBodyScopeMarker):
(WebCore::HTMLNames::isTableRowScopeMarker):
(WebCore::HTMLNames::isForeignContentScopeMarker):
(WebCore::HTMLNames::isButtonScopeMarker):
(WebCore::HTMLNames::isSelectScopeMarker):
(WebCore::HTMLElementStack::ElementRecord::replaceElement):
(WebCore::HTMLElementStack::popUntilNumberedHeaderElementPopped):
(WebCore::HTMLElementStack::popUntilTableScopeMarker):
(WebCore::HTMLElementStack::popUntilTableBodyScopeMarker):
(WebCore::HTMLElementStack::popUntilTableRowScopeMarker):
(WebCore::HTMLElementStack::isMathMLTextIntegrationPoint):
(WebCore::HTMLElementStack::isHTMLIntegrationPoint):
(WebCore::HTMLElementStack::popUntilForeignContentScopeMarker):
(WebCore::HTMLElementStack::pushRootNode):
(WebCore::HTMLElementStack::oneBelowTop):
(WebCore::HTMLElementStack::topmost):
(WebCore):
(WebCore::inScopeCommon):
(WebCore::HTMLElementStack::hasNumberedHeaderElementInScope):
(WebCore::HTMLElementStack::inScope):
* html/parser/HTMLElementStack.h:
(WebCore::HTMLElementStack::topStackItem):
(HTMLElementStack):
(WebCore::isInHTMLNamespace):
* html/parser/HTMLStackItem.h:
(WebCore::HTMLStackItem::isDocumentFragmentNode):
(WebCore::HTMLStackItem::isElementNode):
(HTMLStackItem):
(WebCore::HTMLStackItem::hasLocalName):
(WebCore::HTMLStackItem::hasTagName):
(WebCore::HTMLStackItem::HTMLStackItem):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore):
(WebCore::HTMLTreeBuilder::constructTreeFromAtomicToken):
(WebCore::HTMLTreeBuilder::processFakeEndTag):
(WebCore::HTMLTreeBuilder::processCloseWhenNestedTag):
(WebCore::HTMLTreeBuilder::processStartTagForInBody):
(WebCore::HTMLTreeBuilder::processStartTag):
(WebCore::HTMLTreeBuilder::processAnyOtherEndTagForInBody):
(WebCore::HTMLTreeBuilder::furthestBlockForFormattingElement):
(WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
(WebCore::HTMLTreeBuilder::processEndTagForInTableBody):
(WebCore::HTMLTreeBuilder::processEndTagForInCell):
(WebCore::HTMLTreeBuilder::processEndTagForInBody):
(WebCore::HTMLTreeBuilder::processCaptionEndTagForInCaption):
(WebCore::HTMLTreeBuilder::processTrEndTagForInRow):
(WebCore::HTMLTreeBuilder::processEndTag):
(WebCore::HTMLTreeBuilder::processCharacterBuffer):
(WebCore::HTMLTreeBuilder::processEndOfFile):
(WebCore::HTMLTreeBuilder::shouldProcessTokenInForeignContent):
(WebCore::HTMLTreeBuilder::processTokenInForeignContent):
* html/parser/HTMLTreeBuilder.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123577 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Tests] Copy fast/forms/number/number-spinbutton-change-and-input-events.html to fast/forms/js/resources
https://bugs.webkit.org/show_bug.cgi?id=92209

Reviewed by Kent Tamura.

This patch copies test file fast/forms/number/number-spinbutton-change-and-input-events.html
to JavaScript code directory fast/forms/resources as common-spinbutton-change-and-input-events.js
for sharing code with other input types.

This patch is preparation of re-factoring.

* fast/forms/resources/common-spinbutton-change-and-input-events.js: Copied from LayoutTests/fast/forms/number/number-spinbutton-change-and-input-events.html.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123578 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed r123494 follow-up: fixed inspector undock icon.

* inspector/front-end/Images/statusbarButtonGlyphs.png:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
The EWS bots get flaky when we hit the failure limit
https://bugs.webkit.org/show_bug.cgi?id=92212

Reviewed by Eric Seidel.

Previously we were missing some failure types, which means we didn't
notice that the bots were hitting the failure limit.

* Scripts/webkitpy/common/net/layouttestresults.py:
(LayoutTestResults.failing_test_results):
* Scripts/webkitpy/common/net/layouttestresults_unittest.py:
(LayoutTestResultsTest.test_results_from_string):
(LayoutTestResultsTest.test_tests_matching_failure_types):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123580 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove anonymous namespace and make functions static.
https://bugs.webkit.org/show_bug.cgi?id=92214

Reviewed by Adam Barth.

Mark functions as static instead of enclosing them in anonymous namespaces.
One exception to this rule is when a function is passed as a template argument.
In this case, the function must have an external linkage.

No functional change. Covered by existing tests.

* html/parser/HTMLConstructionSite.cpp:
(WebCore::hasImpliedEndTag):
(WebCore::causesFosterParenting):
(WebCore::isAllWhitespace):
* html/parser/HTMLDocumentParser.cpp:
(WebCore):
(WebCore::tokenizerStateForContextElement):
* html/parser/HTMLElementStack.cpp:
(WebCore::isNumberedHeaderElement):
(WebCore::isRootNode):
(WebCore):
* html/parser/HTMLEntityParser.cpp:
(WebCore::isAlphaNumeric):
* html/parser/HTMLEntitySearch.cpp:
(WebCore::halfway):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore):
* html/parser/HTMLTokenizer.cpp:
(WebCore::toLowerCase):
(WebCore::vectorEqualsString):
(WebCore::isEndTagBufferingState):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore):
(WebCore::uninitializedPositionValue1):
(WebCore::isAllWhitespace):
(WebCore::isAllWhitespaceOrReplacementCharacters):
(WebCore::isNumberedHeaderTag):
(WebCore::isCaptionColOrColgroupTag):
(WebCore::isTableCellContextTag):
(WebCore::isTableBodyContextTag):
(WebCore::isSpecialNode):
(WebCore::isNonAnchorNonNobrFormattingTag):
(WebCore::isNonAnchorFormattingTag):
(WebCore::isFormattingTag):
(WebCore::closestFormAncestor):
(WebCore::mapLoweredLocalNameToName):
(WebCore::adjustSVGTagNameCase):
(WebCore::adjustAttributes):
(WebCore::adjustSVGAttributes):
(WebCore::adjustMathMLAttributes):
(WebCore::addNamesWithPrefix):
(WebCore::adjustForeignAttributes):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123581 268f45cc-cd09-0410-ab3c-d52691b4dbfc
QualifiedName's HashSet should be big enough to hold at least all the static names
https://bugs.webkit.org/show_bug.cgi?id=91891

Patch by Benjamin Poulain  <bpoulain@apple.com> && Joseph Pecoraro <pecoraro@apple.com> on 2012-07-24
Reviewed by Darin Adler.

Source/WebCore: 

QualifiedName's table has a standard size of 64 buckets. When initializing WebKit,
we create 850 static QualifiedName for the standard names (HTMLNames, SVGNames etc).

The small base size forces us to grow and rehash the table several time on startup.

This patch solves the issue by defining the initial table size to the minimum size that
can hold all the static QualifiedName.

* dom/QualifiedName.cpp:
(QualifiedNameHashTraits):
* dom/make_names.pl:
(printNamesHeaderFile):

Source/WTF: 

Add a static struct to compute the HashTable capacity for any given size at compile time.
This allow us to create HashTraits giving the minimumSize without hardcoding the values.

* wtf/HashTable.h:
(OneifyLowBits):
(UpperPowerOfTwoBound):
(HashTableCapacityForSize): Compute the HashTable capacity at compile time.

Tools: 

Add a test for WTF::hashTableCapacityForSize.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/HashSet.cpp: Added.
(InitialCapacityTestHashTraits):
(TestWebKitAPI::testInitialCapacity):
(TestWebKitAPI::generateTestCapacityUpToSize):
(TestWebKitAPI::TEST):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
fast/events/panScroll-click-hyperlink.html test should be put in platform/win
https://bugs.webkit.org/show_bug.cgi?id=92111

Reviewed by Daniel Bates.

Move the test into platform/win directory where other pan scrolling tests reside,
and remove other ports' baselines as they just indicated that pan scrolling is not
supported on those platforms. chromium-win and qt-win platforms still pass the test
but should cope with the default baseline just fine.

* platform/chromium-linux/fast/events/panScroll-click-hyperlink-expected.txt: Removed.
* platform/chromium-win/fast/events/panScroll-click-hyperlink-expected.txt: Removed.
* platform/efl/fast/events/panScroll-click-hyperlink-expected.txt: Removed.
* platform/gtk/TestExpectations:
* platform/mac/fast/events/panScroll-click-hyperlink-expected.txt: Removed.
* platform/qt/fast/events/panScroll-click-hyperlink-expected.txt: Removed.
* platform/win/fast/events/panScroll-click-hyperlink.html: Renamed from LayoutTests/fast/events/panScroll-click-hyperlink.html.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123583 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r123505): Date.getYear() returns the same as Date.getFullYear()
https://bugs.webkit.org/show_bug.cgi?id=92218

Reviewed by Csaba Osztrogonác.

* runtime/DatePrototype.cpp:
(JSC::dateProtoFuncGetYear): Added the missing offset of 1900 to the return value.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123584 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed win build fix against r123569.

* tests/IDBAbortOnCorruptTest.cpp:
* tests/IDBDatabaseBackendTest.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123585 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Fix up includes in HarfBuzzNGFace.h
https://bugs.webkit.org/show_bug.cgi?id=92127

Reviewed by Hajime Morita.

Move constructors of FontPlatformData from headers to corresponding cpp files
so that we can use forward declaration for HarfBuzzNGFace instead of including HarfBuzzNGFace.h.
This way we can include hb.h in HarfBuzzNGFace.h.

No new tests. No changes in behavior.

* platform/graphics/FontPlatformData.cpp:
(WebCore::FontPlatformData::FontPlatformData): Moved from header file.
(WebCore):
* platform/graphics/FontPlatformData.h:
(WebCore):
(FontPlatformData): Moved to cpp file.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm: Include HarfBuzzNGFace.h
* platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp:
(WebCore::FontPlatformData::FontPlatformData): Moved from header file.
(WebCore):
* platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h:
(WebCore):
(FontPlatformData): Moved to cpp file.
* platform/graphics/harfbuzz/ng/HarfBuzzNGFace.h: Include hb.h.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Add ewk_main.{cpp,h} to EFL WK2
https://bugs.webkit.org/show_bug.cgi?id=92101

Patch by Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> on 2012-07-25
Reviewed by Kenneth Rohde Christiansen.

Added a centralized place for general initialization in UI process for EFL WK2.

Source/WebKit2:

* PlatformEfl.cmake:
* UIProcess/API/efl/EWebKit2.h:
* UIProcess/API/efl/ewk_main.cpp: Added.
(ewk_init): General initialization.
(ewk_shutdown): General freeing.
(_ewk_init_body): An aux function.
* UIProcess/API/efl/ewk_main.h: Added.

Tools:

* MiniBrowser/efl/main.c: Added using of newly added ewk_init() and ewk_shutdown() functions.
(main):
* WebKitTestRunner/efl/main.cpp: Ditto.
(main):

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