Ensure we compute the height of replaced elements to 'auto' when appropriate.
https://bugs.webkit.org/show_bug.cgi?id=134700

Reviewed by David Hyatt.

Source/WebCore:
This fixes two issues:

1) If a replaced element has a percentage height specified then its
height should compute to 'auto' when its containing block does not
have a height 'specified explicitly'. We were taking this to mean when
its containing block's specified height value is 'auto' - in fact it
means when the containing block's computed height is auto.

2) Top and bottom on the containing block should only affect the
height of the block if that block has absolute or fixed position.

This brings us into line with IE, Firefox, and Chrome.

This is a port of Blink patches by Rob Hogan and David Vest.

Tests: css2.1/20110323/height-percentage-005.htm
       fast/css/replaced-element-ignore-top-bottom.html

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight):

LayoutTests:
* css2.1/20110323/height-percentage-005-expected.html: Added.
* css2.1/20110323/height-percentage-005.htm: Added.
* css2.1/20110323/support/black96x96.png: Added.
* fast/css/replaced-element-ignore-top-bottom-expected.txt: Added.
* fast/css/replaced-element-ignore-top-bottom.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170895 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Expose a few drawing/compositing settings on WKPreferences(Private)
https://bugs.webkit.org/show_bug.cgi?id=134645

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _compositingBordersVisible]):
(-[WKPreferences _setCompositingBordersVisible:]):
(-[WKPreferences _compositingRepaintCountersVisible]):
(-[WKPreferences _setCompositingRepaintCountersVisible:]):
(-[WKPreferences _tiledScrollingIndicatorVisible]):
(-[WKPreferences _setTiledScrollingIndicatorVisible:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
Expose layer borders, repaint counters, and the tiled scrolling indicator on WKPreferences, as SPI.

* WebView/WebPreferences.mm:
(-[WebPreferences setSubpixelCSSOMElementMetricsEnabled:]):
Remove an extra unnecessary space.

* MiniBrowser/mac/BrowserWindowController.h:
* MiniBrowser/mac/MainMenu.xib:
Add menu items for layer borders and the tiled scrolling indicator.

* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController validateMenuItem:]):
(-[WK1BrowserWindowController layerBordersAreVisible]):
(-[WK1BrowserWindowController toggleLayerBordersVisibility:]):
Add getters/setters/validators for layer borders.

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController awakeFromNib]):
(-[WK2BrowserWindowController validateMenuItem:]):
(-[WK2BrowserWindowController layerBordersAreVisible]):
(-[WK2BrowserWindowController toggleLayerBordersVisibility:]):
(-[WK2BrowserWindowController tiledScrollingIndicatorIsVisible]):
(-[WK2BrowserWindowController toggleTiledScrollingIndicatorVisibility:]):
Add getters/setters/validators for layer borders and the tiled scrolling indicator.

(-[WK2BrowserWindowController isSubpixelCSSOMElementMetricsEnabled]): Deleted.
(-[WK2BrowserWindowController toggleSubpixelCSSOMElementMetricsEnabled:]): Deleted.
Remove the WebKit2 version of the subpixel metrics pref, because it doesn't work, because
nothing in WebKit2 reads this default, and there is no WebKit2 API for adjusting this preference.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170896 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove webkit prefix from pointer lock tests.
https://bugs.webkit.org/show_bug.cgi?id=134744

Patch by Alex Christensen <achristensen@webkit.org> on 2014-07-08
Reviewed by Brady Eidson.

* http/tests/pointer-lock/iframe-sandboxed-allow-pointer-lock-expected.txt:
* http/tests/pointer-lock/iframe-sandboxed-allow-pointer-lock.html:
* http/tests/pointer-lock/iframe-sandboxed-expected.txt:
* http/tests/pointer-lock/iframe-sandboxed-nested-allow-pointer-lock-expected.txt:
* http/tests/pointer-lock/iframe-sandboxed-nested-allow-pointer-lock.html:
* http/tests/pointer-lock/iframe-sandboxed-nested-disallow-then-allow-pointer-lock-expected.txt:
* http/tests/pointer-lock/iframe-sandboxed-nested-disallow-then-allow-pointer-lock.html:
* http/tests/pointer-lock/iframe-sandboxed.html:
* http/tests/pointer-lock/pointerlockelement-different-origin-expected.txt:
* http/tests/pointer-lock/pointerlockelement-different-origin.html:
* http/tests/pointer-lock/pointerlockelement-same-origin-expected.txt:
* http/tests/pointer-lock/pointerlockelement-same-origin.html:
* http/tests/pointer-lock/requestPointerLock-can-not-transfer-between-documents-expected.txt:
* http/tests/pointer-lock/requestPointerLock-can-not-transfer-between-documents.html:
* http/tests/resources/pointer-lock/iframe-common.js:
(document.onpointerlockchange):
(document.onpointerlockerror):
(document.onwebkitpointerlockchange): Deleted.
(document.onwebkitpointerlockerror): Deleted.
* http/tests/resources/pointer-lock/pointer-lock-test-harness.js:
(expectOnlyChangeEvent):
(expectOnlyErrorEvent):
(expectNoEvents):
* pointer-lock/bug90391-move-then-window-open-crash-expected.txt:
* pointer-lock/bug90391-move-then-window-open-crash.html:
* pointer-lock/lock-already-locked-expected.txt:
* pointer-lock/lock-already-locked.html:
* pointer-lock/lock-element-not-in-dom-expected.txt:
* pointer-lock/lock-element-not-in-dom.html:
* pointer-lock/locked-element-iframe-removed-from-dom-expected.txt:
* pointer-lock/locked-element-iframe-removed-from-dom.html:
* pointer-lock/locked-element-removed-from-dom-expected.txt:
* pointer-lock/locked-element-removed-from-dom.html:
* pointer-lock/mouse-event-api-expected.txt:
* pointer-lock/mouse-event-api.html:
* pointer-lock/mouse-event-delivery-expected.txt:
* pointer-lock/mouse-event-delivery.html:
* pointer-lock/pointer-lock-api-expected.txt:
* pointer-lock/pointer-lock-api.html:
* pointer-lock/pointerlockchange-event-on-lock-lost-expected.txt:
* pointer-lock/pointerlockchange-event-on-lock-lost.html:
* pointer-lock/pointerlockchange-pointerlockerror-events-expected.txt:
* pointer-lock/pointerlockchange-pointerlockerror-events.html:
* pointer-lock/pointerlockelement-null-when-pending-expected.txt:
* pointer-lock/pointerlockelement-null-when-pending.html:
Remove webkit prefix on pointer lock functions and events.
This should have been done in r170585.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170897 268f45cc-cd09-0410-ab3c-d52691b4dbfc
VM::lastCachedString should be a Strong, not a Weak.
<https://webkit.org/b/134746>

Using Weak<JSString> for this regressed some of our bindings perf tests
due to Weak having to allocate a new WeakImpl every time the last cached
string changed. Make it a Strong instead should make that problem go away.

Reviewed by Geoffrey Garen.

* runtime/JSString.cpp:
(JSC::jsStringWithCacheSlowCase):
* runtime/VM.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170898 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Debugger popovers should not dismiss when mousing over them
https://bugs.webkit.org/show_bug.cgi?id=134687

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-07-08
Reviewed by David Kilzer.

* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype._trackPopoverEvents):
Actually install the listeners in the set. Regression from code refactoring in r165052.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170899 268f45cc-cd09-0410-ab3c-d52691b4dbfc
resolve-ChangeLogs fails when WebKit repository is a git submodule
https://bugs.webkit.org/show_bug.cgi?id=134734

Reviewed by David Kilzer.

When using resolve-ChangeLogs in a WebKit git repository with a
non-default arrangement of GIT_DIR and GIT_WORK_TREE, incorrect
paths are computed and the script fails mysteriously.

We were naively computing GIT_WORK_TREE as being one level above
GIT_DIR, but this is not the case for submodules or a manually
configured GIT_WORK_TREE or GIT_DIR location.

* Scripts/VCSUtils.pm:
(gitTreeDirectory): Added. Find the equivalent of GIT_WORK_TREE.
(determineVCSRoot): Calculate the working tree root directly.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170900 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebVideoFullscreenInterfaceAVKit should lazily create m_playerController.
https://bugs.webkit.org/show_bug.cgi?id=134706

Patch by Jeremy Jones <jeremyj@apple.com> on 2014-07-08
Reviewed by Simon Fraser.

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenModel):
Don't set the delegate if m_playerController isn't created.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170901 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove WebBackForwardListItems when their owning page goes away
https://bugs.webkit.org/show_bug.cgi?id=134709
<rdar://problem/17584645>

Reviewed by Dan Bernstein.

* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::create):
(WebKit::WebBackForwardListItem::WebBackForwardListItem):
* Shared/WebBackForwardListItem.h:
(WebKit::WebBackForwardListItem::pageID):
Add the associated PageID to the WebBackForwardListItem.

* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::restoreFromState):
Push the current PageID onto the WebBackForwardListItem.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::removeWebPage):
Remove all of the WebBackForwardListItems from m_backForwardListItemMap when
the page they are associated with is removed.

(WebKit::WebProcessProxy::addBackForwardItem):
Push the PageID from the WebProcess onto the WebBackForwardListItem.

* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::idToHistoryItemMap):
(WebKit::historyItemToIDMap):
(WebKit::updateBackForwardItem):
(WebKit::WebBackForwardListProxy::addItemFromUIProcess):
(WebKit::WK2NotifyHistoryItemChanged):
(WebKit::WebBackForwardListProxy::idForItem):
(WebKit::WebBackForwardListProxy::addItem):
(WebKit::WebBackForwardListProxy::goToItem):
(WebKit::WebBackForwardListProxy::close):
* WebProcess/WebPage/WebBackForwardListProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::restoreSession):
Keep track of the PageID that back-forward items were created by.
Pass the PageID along when registering WebBackForwardListItems.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170902 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RemoteInspector::shared() should not call WTF::initializeMainThread()
<https://bugs.webkit.org/show_bug.cgi?id=134747>
<rdar://problem/17161482>

Reviewed by Joseph Pecoraro.

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::shared):
Don't call WTF::initializeMainThread(). WTF threading is initialized by
JSC::initializeThreading().

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