mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
Fix ActiveX impl of innerText to not just be the same as innerHTML. Bug
282317, r=adamlock
This commit is contained in:
parent
74aa22c5f3
commit
33bac2f39c
@ -47,6 +47,7 @@
|
||||
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsIDOMNSHTMLElement.h"
|
||||
#include "nsIDOM3Node.h"
|
||||
#include "nsIDOMDocumentRange.h"
|
||||
#include "nsIDOMRange.h"
|
||||
#include "nsIDOMNSRange.h"
|
||||
@ -616,22 +617,33 @@ HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_innerHTML(BSTR __RPC_FAR *p)
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_innerText(BSTR v)
|
||||
{
|
||||
nsCOMPtr<nsIDOMNSHTMLElement> elementHTML = do_QueryInterface(mDOMNode);
|
||||
if (!elementHTML)
|
||||
nsCOMPtr<nsIDOM3Node> node = do_QueryInterface(mDOMNode);
|
||||
if (!node)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
USES_CONVERSION;
|
||||
nsAutoString innerHTML(OLE2W(v));
|
||||
elementHTML->SetInnerHTML(innerHTML);
|
||||
nsAutoString innerText(OLE2W(v));
|
||||
node->SetTextContent(innerText);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CIEHtmlElement::get_innerText(BSTR __RPC_FAR *p)
|
||||
{
|
||||
return get_innerHTML(p);
|
||||
nsCOMPtr<nsIDOM3Node> node = do_QueryInterface(mDOMNode);
|
||||
if (!node)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsAutoString innerText;
|
||||
node->GetTextContent(innerText);
|
||||
|
||||
USES_CONVERSION;
|
||||
*p = SysAllocString(W2COLE(innerText.get()));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CIEHtmlElement::put_outerHTML(BSTR v)
|
||||
|
Loading…
Reference in New Issue
Block a user