Fix a warning in TestWebKitAPI's MediaTime test-suite
https://bugs.webkit.org/show_bug.cgi?id=94096

Reviewed by Adam Barth.

This warning is visible when building the file with certain GCC versions,
including the one used by Chromium for Android. The warning is visible in
the cr-android build bot output:

MediaTime.cpp:152: warning: this decimal constant is unsigned only in ISO C90

* TestWebKitAPI/Tests/WTF/MediaTime.cpp:
(TestWebKitAPI::TEST):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125683 268f45cc-cd09-0410-ab3c-d52691b4dbfc
There is additional space not belonged to a table between the table cells
https://bugs.webkit.org/show_bug.cgi?id=74864

Patch by Arpita Bahuguna <arpitabahuguna@gmail.com> on 2012-08-15
Reviewed by Julien Chaffraix.

Source/WebCore:

Hittest for a point on the edge, i.e. between two table columns, currently
does not return any matching underlying element.

A hittest on such a point (on the edge of two table columns) should return
the column that lies either on the logical right/bottom of the said point.

Tests: fast/table/hittest-tablecell-bottom-edge.html
       fast/table/hittest-tablecell-right-edge.html
       fast/table/hittest-tablecell-with-borders-bottom-edge.html
       fast/table/hittest-tablecell-with-borders-right-edge.html

* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::spannedRows):
Removed the FIXME regarding the correctness of the usage of the upper_bound algorithm
since that is now verified by the testcases in this patch. Also, the comment
regarding the inconsistency between the algorithms used in spannedRows and spannedColumns
is no longer valid.

(WebCore::RenderTableSection::spannedColumns):
Changed lower_bound() algorithm to upper_bound() for obtaining the next column.
This is now similar to what is used for obtaining the next row in spannedRows().

LayoutTests:

* fast/table/hittest-tablecell-bottom-edge-expected.txt: Added.
* fast/table/hittest-tablecell-bottom-edge.html: Added.
* fast/table/hittest-tablecell-right-edge-expected.txt: Added.
* fast/table/hittest-tablecell-right-edge.html: Added.
Testcases added for verifying that the proper node is returned upon hit test
carried out at a point lying on the edge of two table cells.

* fast/table/hittest-tablecell-with-borders-bottom-edge-expected.txt: Added.
* fast/table/hittest-tablecell-with-borders-bottom-edge.html: Added.
* fast/table/hittest-tablecell-with-borders-right-edge-expected.txt: Added.
* fast/table/hittest-tablecell-with-borders-right-edge.html: Added.
These testcases verify the aforementioned behavior when the table cells
also have border specified for them.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125684 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Gtk] atk_text_get_text_at_offset() fails to provide the correct line for paragraphs in list items whose text wraps
https://bugs.webkit.org/show_bug.cgi?id=83435

Patch by Joanmarie Diggs <jdiggs@igalia.com> on 2012-08-15
Reviewed by Chris Fleizach.

Source/WebCore:

Fix a logic error when checking if an object is a list marker.

* accessibility/gtk/WebKitAccessibleInterfaceText.cpp:
(textForRenderer):

Source/WebKit/gtk:

Updated unit test to include a paragraph in a list item when testing atk_text_get_text_at_offset().

* tests/testatk.c:
(testWebkitAtkGetTextAtOffsetWithSpecialCharacters):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update TestExpectations entry to refer to an actual bug.

* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Change behavior of MasqueradesAsUndefined to better accommodate DFG changes
https://bugs.webkit.org/show_bug.cgi?id=93884

Reviewed by Geoffrey Garen.

Source/JavaScriptCore: 

With some upcoming changes to the DFG to remove uses of ClassInfo, we will be changing the behavior of 
MasqueradesAsUndefined. In order to make this change consistent across all of our execution engines, 
we will make this change to MasqueradesAsUndefined as a separate patch. After this patch, MasqueradesAsUndefined 
objects will only masquerade as undefined in their original context (i.e. their original JSGlobalObject). 
For example, if an object that masquerades as undefined in frame A is passed to frame B, it will not 
masquerade as undefined within frame B, but it will continue to masquerade in frame A.

There are two primary changes that are taking place here. One is to thread the ExecState* through 
JSValue::toBoolean and JSCell::toBoolean so that JSCell::toBoolean can check the object's 
JSGlobalObject to compare it to the lexical JSGlobalObject of the currently running code. If the two 
are distinct, then the object cannot MasqueradeAsUndefined.

The other change is to perform this comparison of JSGlobalObjects everywhere where the MasqueradesAsUndefined
flag in the Structure is checked. For C++ code, this check has been factored into its own function in 
Structure::masqueradesAsUndefined. We only perform this check in the DFG if the current JSGlobalObject has 
had a MasqueradesAsUndefined object allocated within its context. This conditional compilation is managed 
through the use of a WatchpointSet in each JSGlobalObject and alternate create() functions for JS DOM wrappers
that are MasqueradesAsUndefined.

* API/JSValueRef.cpp:
(JSValueToBoolean):
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* bytecode/Watchpoint.h:
(WatchpointSet):
* debugger/DebuggerCallFrame.h:
(JSC::DebuggerCallFrame::callFrame):
* dfg/DFGAbstractState.cpp:
(JSC::DFG::AbstractState::execute):
* dfg/DFGCFGSimplificationPhase.cpp:
(JSC::DFG::CFGSimplificationPhase::run):
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
(JSC::DFG::SpeculativeJIT::compile):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::privateExecute):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_is_undefined):
(JSC::JIT::emit_op_jeq_null):
(JSC::JIT::emit_op_jneq_null):
(JSC::JIT::emit_op_eq_null):
(JSC::JIT::emit_op_neq_null):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_is_undefined):
(JSC::JIT::emit_op_jeq_null):
(JSC::JIT::emit_op_jneq_null):
(JSC::JIT::emit_op_eq_null):
(JSC::JIT::emit_op_neq_null):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncFilter):
(JSC::arrayProtoFuncEvery):
(JSC::arrayProtoFuncSome):
* runtime/BooleanConstructor.cpp:
(JSC::constructBoolean):
(JSC::callBooleanConstructor):
* runtime/JSCell.h:
(JSCell):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::JSGlobalObject):
* runtime/JSGlobalObject.h:
(JSGlobalObject):
(JSC::JSGlobalObject::masqueradesAsUndefinedWatchpoint):
* runtime/JSString.h:
(JSC::JSCell::toBoolean):
(JSC::JSValue::toBoolean):
* runtime/JSValue.h:
* runtime/ObjectConstructor.cpp:
(JSC::toPropertyDescriptor):
* runtime/Operations.cpp:
(JSC::jsTypeStringForValue):
(JSC::jsIsObjectType):
* runtime/Operations.h:
(JSC):
(JSC::JSValue::equalSlowCaseInline):
* runtime/RegExpConstructor.cpp:
(JSC::setRegExpConstructorMultiline):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncToString):
* runtime/Structure.h:
(Structure):
(JSC::Structure::globalObjectOffset):
(JSC::Structure::masqueradesAsUndefined):
(JSC):

Source/WebCore: 

With some upcoming changes to the DFG to remove uses of ClassInfo, we will be changing the behavior of 
MasqueradesAsUndefined. In order to make this change consistent across all of our execution engines, 
we will make this change to MasqueradesAsUndefined as a separate patch. After this patch, MasqueradesAsUndefined 
objects will only masquerade as undefined in their original context (i.e. their original JSGlobalObject). 
For example, if an object that masquerades as undefined in frame A is passed to frame B, it will not 
masquerade as undefined within frame B, but it will continue to masquerade in frame A.

Test: fast/js/document-all-between-frames.html

All of the changes in WebCore are simply passing the additional ExecState argument to JSValue::toBoolean.

* bindings/js/JSCustomSQLStatementErrorCallback.cpp:
(WebCore::JSSQLStatementErrorCallback::handleEvent):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::addEventListener):
(WebCore::JSDOMWindow::removeEventListener):
* bindings/js/JSDataViewCustom.cpp:
(WebCore::getDataViewMember):
* bindings/js/JSDeviceMotionEventCustom.cpp:
(WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
* bindings/js/JSDeviceOrientationEventCustom.cpp:
(WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSDirectoryEntryCustom.cpp:
(WebCore::JSDirectoryEntry::getFile):
(WebCore::JSDirectoryEntry::getDirectory):
* bindings/js/JSDirectoryEntrySyncCustom.cpp:
(WebCore::getFlags):
* bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::JSHTMLCanvasElement::getContext):
* bindings/js/JSInspectorFrontendHostCustom.cpp:
(WebCore::populateContextMenuItems):
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
* bindings/js/JSWebGLRenderingContextCustom.cpp:
(WebCore::dataFunctionMatrix):
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::open):
* bindings/js/JavaScriptCallFrame.cpp:
(WebCore::JavaScriptCallFrame::exec):
(WebCore):
* bindings/js/JavaScriptCallFrame.h:
(JavaScriptCallFrame):
* bindings/js/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::hasBreakpoint):
* bindings/scripts/CodeGeneratorJS.pm: Also add the custom create function for MasqueradesAsUndefined JS DOM wrappers.
(GenerateEventListenerCall):
(GenerateHeader):
(JSValueToNative):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::jsTestEventTargetPrototypeFunctionAddEventListener):
(WebCore::jsTestEventTargetPrototypeFunctionRemoveEventListener):
* bindings/scripts/test/JS/JSTestEventTarget.h:
(WebCore::JSTestEventTarget::create):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::setJSTestObjCreate):
(WebCore::setJSTestObjReflectedBooleanAttr):
(WebCore::setJSTestObjReflectedCustomBooleanAttr):
(WebCore::jsTestObjPrototypeFunctionAddEventListener):
(WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
* bridge/c/c_utility.cpp:
(JSC::Bindings::convertValueToNPVariant):
* bridge/jni/jni_jsobject.mm:
(JavaJSObject::convertValueToJObject):
* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::convertValueToQVariant):

Source/WebKit/mac: 

With some upcoming changes to the DFG to remove uses of ClassInfo, we will be changing the behavior of 
MasqueradesAsUndefined. In order to make this change consistent across all of our execution engines, 
we will make this change to MasqueradesAsUndefined as a separate patch. After this patch, MasqueradesAsUndefined 
objects will only masquerade as undefined in their original context (i.e. their original JSGlobalObject). 
For example, if an object that masquerades as undefined in frame A is passed to frame B, it will not 
masquerade as undefined within frame B, but it will continue to masquerade in frame A.

* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::addValueToArray): Passing ExecState to toBoolean call.

Source/WebKit2: 

With some upcoming changes to the DFG to remove uses of ClassInfo, we will be changing the behavior of 
MasqueradesAsUndefined. In order to make this change consistent across all of our execution engines, 
we will make this change to MasqueradesAsUndefined as a separate patch. After this patch, MasqueradesAsUndefined 
objects will only masquerade as undefined in their original context (i.e. their original JSGlobalObject). 
For example, if an object that masquerades as undefined in frame A is passed to frame B, it will not 
masquerade as undefined within frame B, but it will continue to masquerade in frame A.

* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
(WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant): Passing ExecState to toBoolean call.

LayoutTests: 

Added a test that uses a variety of ways of checking whether something is correctly 
masquerading as undefined (or not) in a subframe.

* fast/js/document-all-between-frames-expected.txt: Added.
* fast/js/document-all-between-frames.html: Added.
* fast/js/resources/document-all-between-frames-subframe.html: Added.
* platform/chromium/TestExpectations: Chromium treats document.all differently, so skip our new test.


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