Changeset 192762 in webkit


Ignore:
Timestamp:
Nov 24, 2015, 12:37:31 AM (10 years ago)
Author:
peavo@outlook.com
Message:

[Win] Implement methods to get and set inner html.
https://bugs.webkit.org/show_bug.cgi?id=151569

Reviewed by Alex Christensen.

  • DOMHTMLClasses.cpp:

(DOMHTMLElement::innerHTML):
(DOMHTMLElement::setInnerHTML):
(DOMHTMLElement::innerText):

Location:
trunk/Source/WebKit/win
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/win/ChangeLog

    r192725 r192762  
     12015-11-24  Per Arne Vollan  <peavo@outlook.com>
     2
     3        [Win] Implement methods to get and set inner html.
     4        https://bugs.webkit.org/show_bug.cgi?id=151569
     5
     6        Reviewed by Alex Christensen.
     7
     8        * DOMHTMLClasses.cpp:
     9        (DOMHTMLElement::innerHTML):
     10        (DOMHTMLElement::setInnerHTML):
     11        (DOMHTMLElement::innerText):
     12
    113== Rolled over to ChangeLog-2015-11-21 ==
  • trunk/Source/WebKit/win/DOMHTMLClasses.cpp

    r188662 r192762  
    503503HRESULT DOMHTMLElement::innerHTML(__deref_opt_out BSTR* result)
    504504{
    505     ASSERT_NOT_REACHED();
    506     if (!result)
    507         return E_POINTER;
    508     *result = nullptr;
    509     return E_NOTIMPL;
     505    if (!result)
     506        return E_POINTER;
     507    String innerHtmlString = downcast<HTMLElement>(m_element)->innerHTML();
     508    *result = BString(innerHtmlString).release();
     509    return S_OK;
    510510}
    511511       
    512 HRESULT DOMHTMLElement::setInnerHTML(_In_ BSTR /*html*/)
    513 {
    514     ASSERT_NOT_REACHED();
    515     return E_NOTIMPL;
     512HRESULT DOMHTMLElement::setInnerHTML(_In_ BSTR html)
     513{
     514    ASSERT(is<HTMLElement>(m_element));
     515    HTMLElement* htmlElement = downcast<HTMLElement>(m_element);
     516    String htmlString(html, SysStringLen(html));
     517    ExceptionCode ec = 0;
     518    htmlElement->setInnerHTML(htmlString, ec);
     519    return S_OK;
    516520}
    517521       
     
    529533{
    530534    ASSERT(is<HTMLElement>(m_element));
    531     HTMLElement* htmlEle = downcast<HTMLElement>(m_element);
     535    HTMLElement* htmlElement = downcast<HTMLElement>(m_element);
    532536    WTF::String textString(text, SysStringLen(text));
    533537    WebCore::ExceptionCode ec = 0;
    534     htmlEle->setInnerText(textString, ec);
     538    htmlElement->setInnerText(textString, ec);
    535539    return S_OK;
    536540}
Note: See TracChangeset for help on using the changeset viewer.