Source/WebCore:
Missing support for innerHTML on SVGElement
https://bugs.webkit.org/show_bug.cgi?id=136903

Patch by Sylvain Galineau <galineau@adobe.com> on 2014-12-02
Reviewed by Dean Jackson.

Two parts to this patch:
1. Move innerHTML/outerHTML to Element so SVG elements can inherit them, per https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#innerhtml
2. Make sure fragment insertion is processed relative to the proper node, per http://www.whatwg.org/specs/web-apps/current-work/#adjusted-current-node

The latter part was ported over from Blink.

Test: svg/in-html/svg-inner-html.html

* bindings/objc/PublicDOMInterfaces.h: Move innerHTML/outerHTML to Element.
* dom/Element.cpp:
(WebCore::Element::mergeWithNextTextNode): Helper used by Element::innerHTML/outerHTML as well as HTMLElement::innerText/outerText; moved to Element as protected static.
(WebCore::Element::innerHTML): Moved from HTMLElement.
(WebCore::Element::outerHTML): Moved from HTMLElement.
(WebCore::Element::setOuterHTML): Moved from HTMLElement.
(WebCore::Element::setInnerHTML): Moved from HTMLElement.
* dom/Element.h:
* dom/Element.idl:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::innerHTML): Deleted.
(WebCore::HTMLElement::outerHTML): Deleted.
(WebCore::HTMLElement::setInnerHTML): Deleted.
(WebCore::mergeWithNextTextNode): Deleted.
(WebCore::HTMLElement::setOuterHTML): Deleted.
* html/HTMLElement.h:
* html/HTMLElement.idl:
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::FragmentParsingContext::FragmentParsingContext): no more m_contextElement.
(WebCore::HTMLTreeBuilder::constructTree): read namespace from adjusted current node.
(WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately): use contextElementStackItem for insertion.
(WebCore::HTMLTreeBuilder::adjustedCurrentStackItem): compute adjusted current node.
(WebCore::HTMLTreeBuilder::shouldProcessTokenInForeignContent): use adjusted current node for context.
(WebCore::HTMLTreeBuilder::processTokenInForeignContent): use adjusted current node to read namespace.
* html/parser/HTMLTreeBuilder.h:
(WebCore::HTMLTreeBuilder::FragmentParsingContext::contextElement): Deleted. Read from contextElementStackItem.
(WebCore::HTMLTreeBuilder::FragmentParsingContext::contextElementStackItem): Added.

LayoutTests:
    Missing support for innerHTML on SVGElement
    https://bugs.webkit.org/show_bug.cgi?id=136903

Patch by Sylvain Galineau <galineau@adobe.com> on 2014-12-02
Reviewed by Dean Jackson.

* js/dom/dom-static-property-for-in-iteration-expected.txt: The property enumeration order is different now that inner/outerHTML are inherited from Element
* platform/mac/svg/in-html/svg-inner-html-expected.png: Added.
* svg/css/svg-attribute-length-parsing-expected.txt:
Now that innerHTML works, the output should start with 'Test'
* svg/in-html/svg-inner-html-expected.txt: Added.
* svg/in-html/svg-inner-html.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176630 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] ewk_view_scale_set() doesn't work correctly
https://bugs.webkit.org/show_bug.cgi?id=139109

Reviewed by Csaba Osztrogonác.

When ewk_view_scale_set() is called, it has only updated a scale factor which is maintained by WebPageProxy.
It causes WebPageProxy unsynchronized with PageViewportController's scale factor. That's why wrong scale
behavior has occured through ewk_view_scale_set(). Besides zooming has similar problem as well.

Thus this patch updates m_pageScaleFactor of PageViewportController as well as prohibits to change the scale
factor through viewport meta tag update. Because ewk_view_scale_set() means that user wants to set a specific
value to scale factor of current viewport.

* UIProcess/API/efl/EwkView.cpp:
(EwkView::updateScaleToPageViewportController):
    Set m_initiallyFitToViewport to false. And call didChangeContentsVisibility() with new scale and scale position.

* UIProcess/API/efl/EwkView.h:
* UIProcess/API/efl/ewk_view.cpp:
(ewk_view_scale_set):
* UIProcess/API/efl/tests/test_ewk2_view.cpp:
(TEST_F):
* UIProcess/CoordinatedGraphics/PageViewportController.cpp:
(WebKit::PageViewportController::didCommitLoad):
    Set m_initiallyFitToViewport to true in order to fit content to viewport size by default.
    Initizlize content position with (0, 0).

(WebKit::PageViewportController::pageTransitionViewportReady):
   Do not update scale when m_initiallyFitToViewport is false.

(WebKit::PageViewportController::syncVisibleContents):
   Return false when syncVisibleContents is failed.

(WebKit::PageViewportController::didChangeViewportAttributes):
   Do not update scale when m_initiallyFitToViewport is false.

(WebKit::PageViewportController::applyScaleAfterRenderingContents):
    If syncVisibleContents() is failed, m_pageScaleFactor should be restored with previous value.
    If not, new scale factor isn't applied though, PageViewportController uses it as own scale factor.

(WebKit::PageViewportController::updateMinimumScaleToFit):
   Do not update scale when m_initiallyFitToViewport is false or m_hadUserInteraction is true.

* UIProcess/CoordinatedGraphics/PageViewportController.h:
(WebKit::PageViewportController::setInitiallyFitToViewport):


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