Fix stack initialization when running under .NET.

Under .NET, on WinXP and sometimes on Win7 we will have two blocks
of uncommited memory before the guard page, so look one block further.

In debug mode it would crash due to assert
guardPage.Protect & PAGE_GUARD

In release mode it would crash due to only using a 4K stack.

Change-Id: If9f2c84122ba95a18403a8f413d080dd5cc58250
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Reduce the command line length when generating bindings

With a working directory of only a few characters longer than our
build machines it's easy to end up getting a
"NMAKE : fatal error U1095" on Windows.

Unlike when invoking the compiler or the linker, we do not use
response files to pass to perl when generating JavaScript bindings.

Reduce the likeliness of getting this error for people building
QtWebKit themselves by avoiding specifying disabled features.
The binding generators do not include Platform.h like the normal
code does.

Task-Number: QTBUG-38632
Change-Id: Iaa1a1c75e8f6a6391f896067adbc5f3b55b59007
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Zooming transforms results in blurry backgrounds

An optimization to speedup pattern transforms results in blurry
background images when using CSS transforms.

This patch disables the optimization when QPainter already has a
transform, and the optimization would be both wrong and probably slower.

Test: svg/as-background-image/svg-transformed-background.html

Task-number: QTBUG-38588
Change-Id: I58739e21fd925048bc91f0ac973fae2036bcf713
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Update RenderImage when the image src is cleared

When the src is removed via JavaScript, the image loader now
updates the renderer.

BUG=123017

Review URL: https://chromiumcodereview.appspot.com/20473002

git-svn-id: svn://svn.chromium.org/blink/trunk@155294 bbb929c8-8fbe-4397-9dbb-9b2b20218538

Task-number: QTBUG-38287
Change-Id: I49c353cfa4ad1f7c1ceac80df81b8cb713d291df
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Fix problems with divot and lineStart mismatches.

https://bugs.webkit.org/show_bug.cgi?id=118662.

Reviewed by Oliver Hunt.

Source/JavaScriptCore:

r152494 added the recording of lineStart values for divot positions.
This is needed for the computation of column numbers. Similarly, it also
added the recording of line numbers for the divot positions. One problem
with the approach taken was that the line and lineStart values were
recorded independently, and hence were not always guaranteed to be
sampled at the same place that the divot position is recorded. This
resulted in potential mismatches that cause some assertions to fail.

The solution is to introduce a JSTextPosition abstraction that records
the divot position, line, and lineStart as a single quantity. Wherever
we record the divot position as an unsigned int previously, we now record
its JSTextPosition which captures all 3 values in one go. This ensures
that the captured line and lineStart will always match the captured divot
position.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitCall):
(JSC::BytecodeGenerator::emitCallEval):
(JSC::BytecodeGenerator::emitCallVarargs):
(JSC::BytecodeGenerator::emitConstruct):
(JSC::BytecodeGenerator::emitDebugHook):
- Use JSTextPosition instead of passing line and lineStart explicitly.
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::emitExpressionInfo):
- Use JSTextPosition instead of passing line and lineStart explicitly.
* bytecompiler/NodesCodegen.cpp:
(JSC::ThrowableExpressionData::emitThrowReferenceError):
(JSC::ResolveNode::emitBytecode):
(JSC::BracketAccessorNode::emitBytecode):
(JSC::DotAccessorNode::emitBytecode):
(JSC::NewExprNode::emitBytecode):
(JSC::EvalFunctionCallNode::emitBytecode):
(JSC::FunctionCallValueNode::emitBytecode):
(JSC::FunctionCallResolveNode::emitBytecode):
(JSC::FunctionCallBracketNode::emitBytecode):
(JSC::FunctionCallDotNode::emitBytecode):
(JSC::CallFunctionCallDotNode::emitBytecode):
(JSC::ApplyFunctionCallDotNode::emitBytecode):
(JSC::PostfixNode::emitResolve):
(JSC::PostfixNode::emitBracket):
(JSC::PostfixNode::emitDot):
(JSC::DeleteResolveNode::emitBytecode):
(JSC::DeleteBracketNode::emitBytecode):
(JSC::DeleteDotNode::emitBytecode):
(JSC::PrefixNode::emitResolve):
(JSC::PrefixNode::emitBracket):
(JSC::PrefixNode::emitDot):
(JSC::UnaryOpNode::emitBytecode):
(JSC::BinaryOpNode::emitStrcat):
(JSC::BinaryOpNode::emitBytecode):
(JSC::ThrowableBinaryOpNode::emitBytecode):
(JSC::InstanceOfNode::emitBytecode):
(JSC::emitReadModifyAssignment):
(JSC::ReadModifyResolveNode::emitBytecode):
(JSC::AssignResolveNode::emitBytecode):
(JSC::AssignDotNode::emitBytecode):
(JSC::ReadModifyDotNode::emitBytecode):
(JSC::AssignBracketNode::emitBytecode):
(JSC::ReadModifyBracketNode::emitBytecode):
(JSC::ForInNode::emitBytecode):
(JSC::WithNode::emitBytecode):
(JSC::ThrowNode::emitBytecode):
- Use JSTextPosition instead of passing line and lineStart explicitly.
* parser/ASTBuilder.h:
- Replaced ASTBuilder::PositionInfo with JSTextPosition.
(JSC::ASTBuilder::BinaryOpInfo::BinaryOpInfo):
(JSC::ASTBuilder::AssignmentInfo::AssignmentInfo):
(JSC::ASTBuilder::createResolve):
(JSC::ASTBuilder::createBracketAccess):
(JSC::ASTBuilder::createDotAccess):
(JSC::ASTBuilder::createRegExp):
(JSC::ASTBuilder::createNewExpr):
(JSC::ASTBuilder::createAssignResolve):
(JSC::ASTBuilder::createExprStatement):
(JSC::ASTBuilder::createForInLoop):
(JSC::ASTBuilder::createReturnStatement):
(JSC::ASTBuilder::createBreakStatement):
(JSC::ASTBuilder::createContinueStatement):
(JSC::ASTBuilder::createLabelStatement):
(JSC::ASTBuilder::createWithStatement):
(JSC::ASTBuilder::createThrowStatement):
(JSC::ASTBuilder::appendBinaryExpressionInfo):
(JSC::ASTBuilder::appendUnaryToken):
(JSC::ASTBuilder::unaryTokenStackLastStart):
(JSC::ASTBuilder::assignmentStackAppend):
(JSC::ASTBuilder::createAssignment):
(JSC::ASTBuilder::setExceptionLocation):
(JSC::ASTBuilder::makeDeleteNode):
(JSC::ASTBuilder::makeFunctionCallNode):
(JSC::ASTBuilder::makeBinaryNode):
(JSC::ASTBuilder::makeAssignNode):
(JSC::ASTBuilder::makePrefixNode):
(JSC::ASTBuilder::makePostfixNode):
- Use JSTextPosition instead of passing line and lineStart explicitly.
* parser/Lexer.cpp:
(JSC::::lex):
- Added support for capturing the appropriate JSTextPositions instead
    of just the character offset.
* parser/Lexer.h:
(JSC::Lexer::currentPosition):
(JSC::::lexExpectIdentifier):
- Added support for capturing the appropriate JSTextPositions instead
    of just the character offset.
* parser/NodeConstructors.h:
(JSC::Node::Node):
(JSC::ResolveNode::ResolveNode):
(JSC::EvalFunctionCallNode::EvalFunctionCallNode):
(JSC::FunctionCallValueNode::FunctionCallValueNode):
(JSC::FunctionCallResolveNode::FunctionCallResolveNode):
(JSC::FunctionCallBracketNode::FunctionCallBracketNode):
(JSC::FunctionCallDotNode::FunctionCallDotNode):
(JSC::CallFunctionCallDotNode::CallFunctionCallDotNode):
(JSC::ApplyFunctionCallDotNode::ApplyFunctionCallDotNode):
(JSC::PostfixNode::PostfixNode):
(JSC::DeleteResolveNode::DeleteResolveNode):
(JSC::DeleteBracketNode::DeleteBracketNode):
(JSC::DeleteDotNode::DeleteDotNode):
(JSC::PrefixNode::PrefixNode):
(JSC::ReadModifyResolveNode::ReadModifyResolveNode):
(JSC::ReadModifyBracketNode::ReadModifyBracketNode):
(JSC::AssignBracketNode::AssignBracketNode):
(JSC::AssignDotNode::AssignDotNode):
(JSC::ReadModifyDotNode::ReadModifyDotNode):
(JSC::AssignErrorNode::AssignErrorNode):
(JSC::WithNode::WithNode):
(JSC::ForInNode::ForInNode):
- Use JSTextPosition instead of passing line and lineStart explicitly.
* parser/Nodes.cpp:
(JSC::StatementNode::setLoc):
- Use JSTextPosition instead of passing line and lineStart explicitly.
* parser/Nodes.h:
(JSC::Node::lineNo):
(JSC::Node::startOffset):
(JSC::Node::lineStartOffset):
(JSC::Node::position):
(JSC::ThrowableExpressionData::ThrowableExpressionData):
(JSC::ThrowableExpressionData::setExceptionSourceCode):
(JSC::ThrowableExpressionData::divot):
(JSC::ThrowableExpressionData::divotStart):
(JSC::ThrowableExpressionData::divotEnd):
(JSC::ThrowableSubExpressionData::ThrowableSubExpressionData):
(JSC::ThrowableSubExpressionData::setSubexpressionInfo):
(JSC::ThrowableSubExpressionData::subexpressionDivot):
(JSC::ThrowableSubExpressionData::subexpressionStart):
(JSC::ThrowableSubExpressionData::subexpressionEnd):
(JSC::ThrowablePrefixedSubExpressionData::ThrowablePrefixedSubExpressionData):
(JSC::ThrowablePrefixedSubExpressionData::setSubexpressionInfo):
(JSC::ThrowablePrefixedSubExpressionData::subexpressionDivot):
(JSC::ThrowablePrefixedSubExpressionData::subexpressionStart):
(JSC::ThrowablePrefixedSubExpressionData::subexpressionEnd):
- Use JSTextPosition instead of passing line and lineStart explicitly.
* parser/Parser.cpp:
(JSC::::Parser):
(JSC::::parseInner):
- Use JSTextPosition instead of passing line and lineStart explicitly.
(JSC::::didFinishParsing):
- Remove setting of m_lastLine value. We always pass in the value from
    m_lastLine anyway. So, this assignment is effectively a nop.
(JSC::::parseVarDeclaration):
(JSC::::parseVarDeclarationList):
(JSC::::parseForStatement):
(JSC::::parseBreakStatement):
(JSC::::parseContinueStatement):
(JSC::::parseReturnStatement):
(JSC::::parseThrowStatement):
(JSC::::parseWithStatement):
(JSC::::parseTryStatement):
(JSC::::parseBlockStatement):
(JSC::::parseFunctionDeclaration):
(JSC::LabelInfo::LabelInfo):
(JSC::::parseExpressionOrLabelStatement):
(JSC::::parseExpressionStatement):
(JSC::::parseAssignmentExpression):
(JSC::::parseBinaryExpression):
(JSC::::parseProperty):
(JSC::::parsePrimaryExpression):
(JSC::::parseMemberExpression):
(JSC::::parseUnaryExpression):
- Use JSTextPosition instead of passing line and lineStart explicitly.
* parser/Parser.h:
(JSC::Parser::next):
(JSC::Parser::nextExpectIdentifier):
(JSC::Parser::getToken):
(JSC::Parser::tokenStartPosition):
(JSC::Parser::tokenEndPosition):
(JSC::Parser::lastTokenEndPosition):
(JSC::::parse):
- Use JSTextPosition instead of passing line and lineStart explicitly.
* parser/ParserTokens.h:
(JSC::JSTextPosition::JSTextPosition):
(JSC::JSTextPosition::operator+):
(JSC::JSTextPosition::operator-):
(JSC::JSTextPosition::operator int):
- Added JSTextPosition.
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::makeFunctionCallNode):
(JSC::SyntaxChecker::makeAssignNode):
(JSC::SyntaxChecker::makePrefixNode):
(JSC::SyntaxChecker::makePostfixNode):
(JSC::SyntaxChecker::makeDeleteNode):
(JSC::SyntaxChecker::createResolve):
(JSC::SyntaxChecker::createBracketAccess):
(JSC::SyntaxChecker::createDotAccess):
(JSC::SyntaxChecker::createRegExp):
(JSC::SyntaxChecker::createNewExpr):
(JSC::SyntaxChecker::createAssignResolve):
(JSC::SyntaxChecker::createForInLoop):
(JSC::SyntaxChecker::createReturnStatement):
(JSC::SyntaxChecker::createBreakStatement):
(JSC::SyntaxChecker::createContinueStatement):
(JSC::SyntaxChecker::createWithStatement):
(JSC::SyntaxChecker::createLabelStatement):
(JSC::SyntaxChecker::createThrowStatement):
(JSC::SyntaxChecker::appendBinaryExpressionInfo):
(JSC::SyntaxChecker::operatorStackPop):
- Use JSTextPosition instead of passing line and lineStart explicitly.

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

Task-number: QTBUG-38708
Change-Id: Ic6a65e8915c634dffe76b7181b38d6be0ab4a45d
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Origin spoofing possible due to inappropriate URL escape sequence decoding

https://bugs.webkit.org/show_bug.cgi?id=131837
rdar://problem/15211936

Reviewed by Anders Carlsson and Dave Hyatt.

Tests: fast/dom/DOMURL/parsing.html
       fast/dom/HTMLAnchorElement/anchor-element-href-parsing.html

* platform/URL.cpp:
(WebCore::URL::host): Removed unnecessary call to
decodeURLEscapeSequences, which caused
problems and was not needed.

Change-Id: Idddc6efe310389b8e68db2d8c312c2098121e6d9
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167480 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Fix crash in pixmapToImageData binding

The result of JSContextGetGlobalObject is a wrapper-object not a
direct pointer to the global object. Instead access the global object
directly since we are already using other parts of the internal JS API.

The patch also adds a missing API shim that should be held when using the
internal JS API.

Task-number: QTBUG-38809
Change-Id: I76eccbbd6cb1b9fd3322596bb7d6a3f9b0e694b8
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Fix leak of QSensors on QWebPage creation

The WebCore page supplements are not deleted when the page is, so we
need to track them in QWebPageAdapter and delete them there.

Task-number: QTBUG-38857
Change-Id: Ib3e41074de3bebf00f017523d28efc1c923250f3
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Stop the clearContentsTimer when removing an image backing.

It creates a race condition that can lead to crashes when the WebView's
visible property is set to false and the image backing is removed
shortly after.

Task-number: QTBUG-38841
Change-Id: I0775ba33fda9cee5f86ef50a4fbe048602564296
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Fix scrollbar handles so it follows cursor position when on a page

When a webpage contains a scrollbar as part of an element inside it
then the scrollbar handle should be in sync with the cursor when
the handle is moved.

Task-number: QTBUG-38360
Change-Id: I1f5474ad9b5e8dc232b307f4c5927833577afe1b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Fix animation errors with radio buttons and checkboxes on Windows.

The QWindowsVistaStyle used the animation state of the control's
style object. Since this is the QWebView for controls used in
QtWebKit, this leads to unpredictable painting behavior.

Task-number: QTBUG-30072
Change-Id: I1ba572bfbf56745b8e85fd631a596c43aa2ba25a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Images wastes time on prescaling before OpenGL painting

WebCore prescale images under cirtain circumstances to work-around poor
downscaling in the raster QPainter. This is however unnecessary and
harmful to performance when using a OpenGL paint engine.

This patch makes sure the prescaling logic is only used for the raster
paint engine.

Change-Id: I321894ee6adec097d827e9997ebf951960ee91a4
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Deploy QML plugin type information to correct directory.

This adds the plugins.qmltypes file to the list of files that are
deployed to the qml/QtWebKit directory.

This is needed e.g. for auto-completion in Creator.

Patch co-authored with Fawzi Mohamed.

Task-number: QTBUG-39013
Change-Id: Icce9a168a0558652b810ad16c89895e24a6fc6ef
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
[CoordinatedGraphics] Segmentation fault at  CoordinatedGraphicsScene::clearImageBackingContents

https://bugs.webkit.org/show_bug.cgi?id=125776

Patch by Edit Balint <edbalint@inf.u-szeged.hu> on 2014-01-20
Reviewed by Csaba Osztrogonác.

Unexpected behavior occurs in some test cases which leads to segmentation fault.

* platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
(WebCore::CompositingCoordinator::removeImageBacking):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162329 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Task-number: QTBUG-38841
Change-Id: I85699c26f9ec78d97d66cf734188ba7da7e2233e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
CopyLinkToClipboard should copy the URL only

The addition of title information to the dragged or copied links, has
caused the clipboard after CopyLinkToClipboard to paste the link title
instead of the link URL when doing a simple paste.

This paste removes the title from the MimeData so that QMimeData must
return the text version of the URL when pasting text.

Task-number: QTBUG-39341
Change-Id: Ia28ea0f0eda07a4133c5628b60db624a16ed9931
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Account for extra uncommitted memory size also in ASSERTs.

The fix for the stack layout in applications that are loading .NET
libraries in addition did not update the assertions that make sure
that the actual end of the stack is where it should be.

Task-number: QTBUG-38067
Change-Id: Ib8be1228bc9f10baf8d3484bb280a3a5c8021ab8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Ensure replaced tiles are repainted

If a layer with a backing store is resized, we may replace some tiles
that were not at maximum size. When that happens we need to ensure the
replaced area is repainted, otherwise the content disappears until
refreshed.

Change-Id: Ie2f7796a2493a56ed5fc6cc4cea55f4ab9f38bbe
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Avoid deep copy when updating BitmapTextureGL

Since we use a ImageBuffer to paint into a BitmapTextureGL, and
ImageBuffer's always have an active painter, the convertion from QPixmap
to QImage causes a deep copy of the content before it is uploaded to
OpenGL. This copy is unnecessary and can be avoided by temporarily
redirecting the QPaintDevice.

Change-Id: I0106c0f6dfb9cc3fbbee943411fc8f6853df4f98
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Do not crash or assert on SVG font fallbacks

Fonts falling back to SVG fonts may not have a rendering context, so
just skip kerning in this case.

Task-number: QTBUG-38356
Change-Id: I9d1473bbb8517bfae927e7b020a9c2102c6497b4
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
[mips] Fix branchTruncateDoubleToUint32 implementation in macro assembler.

Test dfg-uint32array-overflow-values fails without this patch.

Change-Id: Ia186ab5c3fbc19fd7621f5cc60678b82a6424641
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>