[WebGL] getUniformLocation fails for uniform array name without array brackets
https://bugs.webkit.org/show_bug.cgi?id=99854

Patch by Max Vujovic <mvujovic@adobe.com> on 2012-10-19
Reviewed by Dean Jackson.

Before this patch, gl.getUniformLocation(program, "array[0]") would return the array
location, but gl.getUniformLocation(program, "array") would not. Now, the latter also
returns the array location.

In the process of adding a check to the following Khronos WebGL conformance test:
conformance/glsl/misc/glsl-long-variable-names.html

* platform/graphics/ANGLEWebKitBridge.cpp:
(WebCore::getSymbolInfo):
    Before, we used to check that the symbol size was greater than one to determine that the
    symbol was an array. However, this doesn't identify arrays of length one. Now, we check
    if the symbol name ends in "[0]", since ANGLE appends this suffix to array symbol
    names.
    If the symbol is an array, we strip off the "[0]" and add a symbol with just the base
    name. We set the isArray flag on the symbol, so we don't lose the information that it is
    an array.
    Then, we create symbols for each array element like before. However, instead of
    replacing the "0" in array[0]" with each index, we take the base name "array" and
    append array brackets containing each index (e.g. "array" + "[7]").
* platform/graphics/ANGLEWebKitBridge.h:
(ANGLEShaderSymbol):
    Add isArray boolean to ANGLEShaderSymbol. Since array symbols don't end in "[0]"
    anymore, this is the only way to identify arrays.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131952 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Page should be removed from the cache right after restore was called.
https://bugs.webkit.org/show_bug.cgi?id=99737

Patch by Dima Gorbik <dgorbik@apple.com> on 2012-10-19
Reviewed by Brady Eidson.

The pageCache was inconsistent after the restoration for a period of time because the cachedFrame is being nulled,
but the page is still in the Cache. Now the page is being removed from the cache right after the restoration.
This issue was spotted in a custom built application using WebKit and unfortunately there is no way to test this
behavior in LayoutTests. All the current tests that exercise the page cache do pass.

No new tests.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131953 268f45cc-cd09-0410-ab3c-d52691b4dbfc
String(CFStringRef) should try to converting to an 8 bit string before converting to  16 bit string
https://bugs.webkit.org/show_bug.cgi?id=99794

Reviewed by Filip Pizlo.

Try getting a Latin1 byte string before getting a UTF16 (UChar*) string.

No new test, added 8 bit path.

* platform/text/cf/StringCF.cpp:
(WTF::String::String):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131954 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add String version of visitedLinkHash() to properly handle 8-bit URL Strings.
https://bugs.webkit.org/show_bug.cgi?id=99735

Reviewed by Filip Pizlo.

Added String version of visitedLinkHash().  Made speculative addition of visitedLinkHash()
to chromium platform version of LinkHashChromium.cpp.
Changed calls in the form of visitedLinkHash(string.characters(), string.length()) to use the
new form.

No changes to functionality, so no new tests.

* WebCore.exp.in:
* loader/HistoryController.cpp:
(WebCore::addVisitedLink):
* page/PageGroup.cpp:
(WebCore::PageGroup::addVisitedLink):
* platform/LinkHash.cpp:
(WebCore::visitedLinkHashInline):
(WebCore::visitedLinkHash):
* platform/LinkHash.h:
* platform/chromium/LinkHashChromium.cpp:
(WebCore::visitedLinkHash):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131955 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Lexer should create 8 bit Identifiers for RegularExpressions and ASCII identifiers
https://bugs.webkit.org/show_bug.cgi?id=99855

Reviewed by Filip Pizlo.

Added makeIdentifier helpers that will always make an 8 bit Identifier or make an
Identifier that is the same size as the template parameter.  Used the first in the fast
path when looking for a JS identifier and the second when scanning regular expressions.

* parser/Lexer.cpp:
(JSC::::scanRegExp):
* parser/Lexer.h:
(Lexer):
(JSC::::makeIdentifierSameType):
(JSC::::makeLCharIdentifier):
(JSC::::lexExpectIdentifier):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131956 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: aria-hidden=false does not work as expected
https://bugs.webkit.org/show_bug.cgi?id=98787

Reviewed by Beth Dakin.

Source/WebCore: 

ARIA requires that aria-hidden=false override an element's native visibility and include that
node in the AX hierarchy.

To accomplish this we have to allow invisible items to be included, as well as items that
have no renderers associated with them.

Test: accessibility/aria-hidden-negates-no-visibility.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::getOrCreate):
* accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::addTableCellChild):
(WebCore::AccessibilityARIAGrid::addChildren):
* accessibility/AccessibilityARIAGrid.h:
(AccessibilityARIAGrid):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore):
       (WebCore::AccessibilityNodeObject::boundingBoxRect):
(WebCore::AccessibilityNodeObject::insertChild):
(WebCore::AccessibilityNodeObject::addChild):
(WebCore::AccessibilityNodeObject::addChildren):
(WebCore::AccessibilityNodeObject::textUnderElement):
* accessibility/AccessibilityNodeObject.h:
(AccessibilityNodeObject):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::textIteratorBehaviorForTextRange):
(WebCore):
* accessibility/AccessibilityObject.h:
(AccessibilityObject):
(WebCore::AccessibilityObject::addChild):
(WebCore::AccessibilityObject::insertChild):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore):
(WebCore::AccessibilityRenderObject::accessibilityIsIgnoredBase):
(WebCore::AccessibilityRenderObject::addHiddenChildren):
(WebCore::AccessibilityRenderObject::addChildren):
* accessibility/AccessibilityRenderObject.h:
(AccessibilityRenderObject):

LayoutTests: 

* accessibility/aria-hidden-negates-no-visibility.html: Added.
* platform/mac/accessibility/aria-hidden-negates-no-visibility-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131957 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add infrastructure for NetworkProcess management
https://bugs.webkit.org/show_bug.cgi?id=99817

Reviewed by Alexey Proskuryakov.

Add support for the WebProcess itself requesting a connection to the default NetworkProcess.

Add proper handling of crashes so any of the Web/Network/UI processes crash the others take appropriate action.

Project file stuff and general messaging changes:
* DerivedSources.make:
* Platform/CoreIPC/MessageID.h:
* WebKit2.xcodeproj/project.pbxproj:
* Platform/CoreIPC/HandleMessage.h:
(CoreIPC):
(CoreIPC::callMemberFunction): Add some new required templates.

WebContext now does much less of this stuff:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::createNewWebProcess):
* UIProcess/WebContext.h:
(WebContext):

UIProcess now has a process manager to handle most of this:
* UIProcess/Network/NetworkProcessManager.cpp:
(WebKit):
(WebKit::NetworkProcessManager::shared):
(WebKit::NetworkProcessManager::NetworkProcessManager):
(WebKit::NetworkProcessManager::getNetworkProcessConnection):
(WebKit::NetworkProcessManager::ensureNetworkProcess):
(WebKit::NetworkProcessManager::removeNetworkProcessProxy):
* UIProcess/Network/NetworkProcessManager.h:
(WebKit):
(NetworkProcessManager):

Flesh out the NetworkProcessProxy to handle creating these connections between Network and Web Processes:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::create):
(WebKit::NetworkProcessProxy::NetworkProcessProxy):
(WebKit::NetworkProcessProxy::getNetworkProcessConnection):
(WebKit):
(WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch):
(WebKit::NetworkProcessProxy::didReceiveMessage):
(WebKit::NetworkProcessProxy::didClose):
(WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):
(WebKit::NetworkProcessProxy::didFinishLaunching):
* UIProcess/Network/NetworkProcessProxy.h:
(WebKit):
(NetworkProcessProxy):
* UIProcess/Network/NetworkProcessProxy.messages.in:

Add a class representing a connection from a NetworkProcess to a particular WebProcess:
* NetworkProcess/NetworkConnectionToWebProcess.cpp: Added.
(WebKit):
(WebKit::NetworkConnectionToWebProcess::create):
(WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
(WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess):
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
(WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::didReceiveInvalidMessage):
(WebKit::NetworkConnectionToWebProcess::didReceiveNetworkConnectionToWebProcessMessage):
* NetworkProcess/NetworkConnectionToWebProcess.h:
(WebKit):
(NetworkConnectionToWebProcess):
(WebKit::NetworkConnectionToWebProcess::connection):
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:

Add the ability for a NetworkProcess to create a connection for a different process, which is used on behalf of WebProcesses for now:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
(WebKit):
(WebKit::NetworkProcess::didClose):
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
* NetworkProcess/NetworkProcess.h:
(WebKit):
(NetworkProcess):
* NetworkProcess/NetworkProcess.messages.in:

Forward on the message that a WebProcess wants a connection to a NetworkProcess:
* UIProcess/WebProcessProxy.cpp:
(WebKit):
(WebKit::WebProcessProxy::getNetworkProcessConnection):
* UIProcess/WebProcessProxy.h:
(WebProcessProxy):
* UIProcess/WebProcessProxy.messages.in:

Add a class representing the WebProcesses connection to the NetworkProcess:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit):
(WebKit::NetworkProcessConnection::NetworkProcessConnection):
(WebKit::NetworkProcessConnection::~NetworkProcessConnection):
(WebKit::NetworkProcessConnection::didReceiveMessage):
(WebKit::NetworkProcessConnection::didReceiveSyncMessage):
(WebKit::NetworkProcessConnection::didClose):
(WebKit::NetworkProcessConnection::didReceiveInvalidMessage):
* WebProcess/Network/NetworkProcessConnection.h:
(WebKit):
(NetworkProcessConnection):
(WebKit::NetworkProcessConnection::create):
(WebKit::NetworkProcessConnection::connection):

Have the WebProcess make sure it has a connection to the NetworkProcess, even though it currently does nothing with it:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit):
(WebKit::WebProcess::ensureNetworkProcessConnection):
(WebKit::WebProcess::networkProcessConnectionClosed):
(WebKit::WebProcess::networkProcessCrashed):
* WebProcess/WebProcess.h:
(WebKit):
(WebProcess):
* WebProcess/WebProcess.messages.in:

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