Fix uninitialized access

When an identifier is made from an empty string, the constructor still
tries accessing the first character to populate a cache. This leads to
access of uninitialized data, and wrong data in the cache. This causes
no wrong behavior though except unuseful data in the cache.

Change-Id: Ice9f10b08306799b160f8b95b76bd056f29d228d
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Fix uninitialized access in RenderTable

WTF::Vector's do not initialize primitive types, so we need to do so,
especially for the last columnpos which needs be the highest.

Change-Id: Iec68e12352b76d304faa59d3233cbbb38691d78d
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Fix assertion in PerformanceTiming

We get negative values in monotonic increasing time because we forget
to initialize the start time.

Change-Id: I292792f8f996025e7f0254bb90391b7af6873877
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Fix valgrind warning about uninitialized access

A default cache-entry has a null String and an uninitialized key. We
should therefore only try to use the key if the String is not null.

Change-Id: Icd6819b96b9b650305cf0611b6b2978c07dc9196
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Do not let platform font-engine handle zero-width spaces

WebCore has special handling of zero-width spacing, including using
a glyph with index 0 to represent it if the font doesn't have one. This
handling might get overridden by QRawFont::advancesForGlyphIndexes which
redoes advances for everything not marked as spaces.

This patch makes WebCore mark the zero-width spaces as spaces for
width iteration thereby handling it on the WebCore side instead of by
the platform font-engine.

Task-number: QTBUG-40912
Change-Id: Ida1711d3c65f1954273c786c902ef3ae77a72558
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Fix repainting of subpixel positioned composited layers

Since the offset-from-renderer includes the pixel snapping based on
subpixel accumulation, we should take the accumulation into account to
calculate the repaint area in layer coordinates.

Task-number: QTBUG-40218
Change-Id: I66f9cb0943ba69bb892c686ecea9ed5fec805a0d
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Improve layout and rendering speed of complex font path

This patch enables the use of the TextLayout object previously only used
by the Mac port. This caches a line of laid out text making reflowing
text much faster when using the complex font path.

The patch also enables caching in the QTextLayout, this improves also
drawing and measuring of complex fonts, since previously we would throw
away details of the layout after calculating a line, but then
recalculate it for drawing or measuring.

Change-Id: I9db40cdb5a35d28072204f950a8aa50669ac643b
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
use after free in WebCore::DocumentOrderedMap::remove / WebCore::TreeScope::removeElementById

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

Reviewed by Ryosuke Niwa.

Update the document ordered map for an image element before dispatching
load or error events
when it's inserted into a document.

Source/WebCore:

Test: fast/dom/modify-node-and-while-in-the-callback-too-crash.html

* dom/DocumentOrderedMap.cpp: defensive fix to avoid use after free
issues.
(WebCore::DocumentOrderedMap::remove):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::insertedInto):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement): setting m_failedLoadURL makes
repeated updateFromElement calls return early.

Change-Id: I305e56de969d0efe3dc67930cdf585a201e8c6a5
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159481 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
A fractional value of the css letter-spacing property is not rendered as expected

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

Reviewed by Simon Fraser.

Source/WebCore:

This turns on fractional letter-spacing and word-spacing CSS values.
It is taken mostly from Blink r153727 and iOS. Updating the relevant
types is all that is necessary

* css/DeprecatedStyleBuilder.cpp:
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* platform/graphics/Font.cpp:
(WebCore::Font::Font):
(WebCore::Font::width):
* platform/graphics/Font.h:
(WebCore::Font::wordSpacing):
(WebCore::Font::letterSpacing):
(WebCore::Font::setWordSpacing):
(WebCore::Font::setLetterSpacing):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::wordSpacing):
(WebCore::RenderStyle::letterSpacing):
(WebCore::RenderStyle::setWordSpacing):
(WebCore::RenderStyle::setLetterSpacing):
* rendering/style/RenderStyle.h:

Change-Id: I49cedbf555426f3fae3fe58ec4eb25569d358997
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161521 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Fix letter-spacing in SVG

Qt incorrectly included letter-spacing when WebCore asked us to ignore
it which broke SVG rendering of letter-spaced text in the complex
font path.

Task-number: QTBUG-39601
Change-Id: Ia951e12ac5503955eb0e34e214219f9136c71465
Reviewed-by: Julien Brianceau <jbriance@cisco.com>
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Fix clang debug-and-release build

Under circumstances clang will leave code that calls the dead default
constructor of Attribute, which causes link time errors.

Change-Id: I265f5b6ee864737c8261cff1439d525000eed1ba
Reviewed-by: Sergio Ahumada <sahumada@blackberry.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>
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>
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>
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>
Simplify ImageBuffer conversion using RGBA8888 formats

Using the RGBA8888 formats introduced in Qt 5.2, we can remove the
corresponding code in WebKit. This greatly simplifies the code.

Change-Id: I3df43995c4df53610fc881c68998188ec08370f9
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Merge pull request #99 from gtalusan/kobo

cherry-pick some upstream qtwebkit fixes
avoid cut-off for character g, q on horizontal writing mode
Merge pull request #101 from zxu/DE7655_2

avoid cut-off for character g, q on horizontal writing mode
revert webkit patch to avoid overlapping on fixed layout book