Gmail reply email - Bold and Italic style  get stuck
https://bugs.webkit.org/show_bug.cgi?id=118185

Patch by Vani Hegde <vani.hegde@samsung.com> on 2013-07-30
Reviewed by Ryosuke Niwa.

Source/WebCore:

When bold/italic style is applied to a content with mixed editability,
style is applied appropriately for the first time.
But after this, style toggling does not work any more. Same behavior
can be observed when the content on which style is applied contains
text node without renderer (Ex: text node corresponding to tab/space etc)

When bold/italic style is applied on a selection, we actually apply the
style only for text nodes that have renderers and also are contenteditable.
Similarly during style toggling, to check whether a style has been already
applied on a selection

Tests: editing/style/toggle-style-bold-italic-mixed-editability.html
       editing/style/toggle-style-bold-italic.html

* editing/EditingStyle.cpp:
(WebCore::EditingStyle::triStateOfStyle):
A particular selection on which style is applied may contain text nodes
without renderers(text nodes corresponding to tab/space) or text nodes
that are not contenteditable. We do not apply style to such text nodes.
Hence, even during style toggling we should not consider the styles
present in such nodes.

LayoutTests:

Layout tests added to test bold/italic style toggling on a content
with mixed editability.

* editing/editing.js:
(runDumpAsTextEditingTest): Replaced markupResultList with
elementsForDumpingMarkupList to store all markup data to be logged
at the end of test.
(debugForDumpAsText): Changed to use elementsForDumpingMarkupList.
(startNewMarkupGroup): Added utility function to hold intermediate
data by separating <ol>.
* editing/style/toggle-style-bold-italic-expected.txt: Added.
* editing/style/toggle-style-bold-italic-mixed-editability-expected.txt: Added.
* editing/style/toggle-style-bold-italic-mixed-editability.html: Added.
* editing/style/toggle-style-bold-italic.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153509 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Dotted borders render w/ artifacts and sometimes as solid lines
https://bugs.webkit.org/show_bug.cgi?id=3964

Patch by Pravin D <pravind@samsung.com> on 2013-07-30
Reviewed by Elliott Sprehn.

Source/WebCore:

While drawing the dotted border, the common borders are drawn by the cells sharing them. The dotted borders
become(tend) solid when the starting and the end points of the border drawn by the two cells don't match. This
fixes the same.

Test: fast/table/border-collapsing/dotted-collapsed-border.html

* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::alignLeftRightBorderPaintRect):
(WebCore::RenderTableCell::alignTopBottomBorderPaintRect):
 Helper function to decide if border's start point requires any adjustment.

(WebCore::RenderTableCell::paintCollapsedBorders):
Added logic to handle dotted borders so that they do not become solid.

* rendering/RenderTableCell.h:
 Helper function declarations.

LayoutTests:

* fast/table/border-collapsing/dotted-collapsed-border-expected.txt: Added.
* fast/table/border-collapsing/dotted-collapsed-border.html: Added.
* platform/qt/fast/table/border-collapsing/dotted-collapsed-border-expected.png: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153510 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DHTML drag can result in a null-deref under WebDragClient::startDrag
https://bugs.webkit.org/show_bug.cgi?id=119297
<rdar://problem/14213012>

Reviewed by Simon Fraser.

Test: fast/events/setDragImage-in-document-element-crash.html

* page/mac/FrameSnapshottingMac.mm:
(WebCore::snapshotDragImage):
We shouldn't waste time painting an empty image, nor should we return
an image with no size.

Add a test that ensures that using a zero-size in-document non-<img>
element for setDragImage() doesn't crash.

* fast/events/setDragImage-in-document-element-crash-expected.txt: Added.
* fast/events/setDragImage-in-document-element-crash.html: Added.

* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::convertImageToBitmap):
ShareableBitmap::createShareable can return null, but shouldn't dereference that.


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