Some refinements in FrameView::layout
https://bugs.webkit.org/show_bug.cgi?id=121076

Reviewed by Andreas Kling.

* page/FrameView.cpp:
(WebCore::FrameView::layout): Use a reference for the document in
this function since code assumes it's non-null anyway. Change code to
only call styleResolverIfExists once. Rewrite comments about blocks
and the scopes they create for better clarity. Make m_nestedLayoutCount
easier to read. Use HTMLElement* for the pointer to the body element.
Moved the call to calculateScrollbarModesForLayout in so we don't
waste time doing it for subtree layouts. Get rid of the unhelpful
currentHMode and currentVMode local variables. Get rid of an extra
block scope we did not need.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
When deleting editable content, typing style should be reset when moving into another node.
https://bugs.webkit.org/show_bug.cgi?id=120726

Reviewed by Ryosuke Niwa.

Source/WebCore:

When moving from one text node to the other, while deleting characters,
the deleted text node's style was being applied to any new characters
added into the existing text node.

Typing Style in the frame selection maintains the editing style for the
deleted text node, so that if new characters are inserted at the position
of the deleted text node, it's style can be applied to them.

However, when moving into another text node, we should reset or clear the
typing style maintained by the frame selection. This ensures that any new
content inserted within the existing node does not take on any uncleared
style of the deleted node.

Test: editing/deleting/maintain-style-after-delete.html

* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::saveTypingStyleState):
Calling clearTypingStyle() on frame selection whenever deletion occurs
within the same text node. Thus any existing typing styleh held by the
frame selection shall be cleared.

LayoutTests:

* editing/deleting/maintain-style-after-delete-expected.txt: Added.
* editing/deleting/maintain-style-after-delete.html: Added.
Testcase added for verifying that style of the text node being deleted
is maintained.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Test /webkit/atk/getTextInParagraphAndBodyModerate fails
https://bugs.webkit.org/show_bug.cgi?id=105538

Reviewed by Chris Fleizach.

Source/WebCore:

Expose '\n' for linebreaks when they were explicitly set by the
author of the web content with a <br> tag.

Tests: accessibility/paragraph-with-linebreaks.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::shouldAddSpaceBeforeAppendingNextElement): Helper
function to decide when to append spaces when building the text
under an element, considering line breaks.
(WebCore::AccessibilityNodeObject::textUnderElement): Use the
shouldAddSpaceBeforeAppendingNextElement() function here.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textUnderElement): Return the
renderer's text for accessibility objects exposing <br> elements.
* html/parser/HTMLParserIdioms.h:
(WebCore::isHTMLSpaceButNotLineBreak): New helper function, useful
to be passed to other functions like simplifyWhiteSpace().

Tools:

Unskip passing test getTextInParagraphAndBodyModerate.

* Scripts/run-gtk-tests:
(TestRunner): Unskip pasing test.

LayoutTests:

Added new Layout test and platform specific expectations.

* platform/efl/accessibility/paragraph-with-linebreaks-expected.txt: Added.
* platform/gtk/accessibility/paragraph-with-linebreaks-expected.txt: Added.
* accessibility/paragraph-with-linebreaks.html: Added.

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