mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
awful regression of not copypasting from textareas! fixed.r=akkana,anthonyd
This commit is contained in:
parent
ef35aeadcc
commit
938dbdf044
@ -3446,6 +3446,28 @@ nsDocument::CreateXIF(nsString & aBuffer, nsIDOMSelection* aSelection)
|
|||||||
{
|
{
|
||||||
if (NS_SUCCEEDED(aSelection->GetFocusNode(getter_AddRefs(focus))))
|
if (NS_SUCCEEDED(aSelection->GetFocusNode(getter_AddRefs(focus))))
|
||||||
{
|
{
|
||||||
|
//check to see if these are text nodes if so there is still a chance at optimization
|
||||||
|
//from checking their respective parents
|
||||||
|
if (focus.get() != anchor.get())
|
||||||
|
{
|
||||||
|
nsCOMPtr<nsIDOMText> domText(do_QueryInterface(focus));
|
||||||
|
if (domText)
|
||||||
|
{
|
||||||
|
nsCOMPtr<nsIDOMNode> parent;
|
||||||
|
result = focus->GetParentNode(getter_AddRefs(parent));
|
||||||
|
if (NS_SUCCEEDED(result) && parent)
|
||||||
|
focus = parent;
|
||||||
|
}
|
||||||
|
domText = do_QueryInterface(anchor);
|
||||||
|
if (domText)
|
||||||
|
{
|
||||||
|
nsCOMPtr<nsIDOMNode> parent;
|
||||||
|
result = anchor->GetParentNode(getter_AddRefs(parent));
|
||||||
|
if (NS_SUCCEEDED(result) && parent)
|
||||||
|
anchor = parent;
|
||||||
|
}
|
||||||
|
}//end parent checking
|
||||||
|
|
||||||
if (focus.get() == anchor.get())
|
if (focus.get() == anchor.get())
|
||||||
{
|
{
|
||||||
rootElement = do_QueryInterface(focus);//set root to top of selection
|
rootElement = do_QueryInterface(focus);//set root to top of selection
|
||||||
|
@ -3446,6 +3446,28 @@ nsDocument::CreateXIF(nsString & aBuffer, nsIDOMSelection* aSelection)
|
|||||||
{
|
{
|
||||||
if (NS_SUCCEEDED(aSelection->GetFocusNode(getter_AddRefs(focus))))
|
if (NS_SUCCEEDED(aSelection->GetFocusNode(getter_AddRefs(focus))))
|
||||||
{
|
{
|
||||||
|
//check to see if these are text nodes if so there is still a chance at optimization
|
||||||
|
//from checking their respective parents
|
||||||
|
if (focus.get() != anchor.get())
|
||||||
|
{
|
||||||
|
nsCOMPtr<nsIDOMText> domText(do_QueryInterface(focus));
|
||||||
|
if (domText)
|
||||||
|
{
|
||||||
|
nsCOMPtr<nsIDOMNode> parent;
|
||||||
|
result = focus->GetParentNode(getter_AddRefs(parent));
|
||||||
|
if (NS_SUCCEEDED(result) && parent)
|
||||||
|
focus = parent;
|
||||||
|
}
|
||||||
|
domText = do_QueryInterface(anchor);
|
||||||
|
if (domText)
|
||||||
|
{
|
||||||
|
nsCOMPtr<nsIDOMNode> parent;
|
||||||
|
result = anchor->GetParentNode(getter_AddRefs(parent));
|
||||||
|
if (NS_SUCCEEDED(result) && parent)
|
||||||
|
anchor = parent;
|
||||||
|
}
|
||||||
|
}//end parent checking
|
||||||
|
|
||||||
if (focus.get() == anchor.get())
|
if (focus.get() == anchor.get())
|
||||||
{
|
{
|
||||||
rootElement = do_QueryInterface(focus);//set root to top of selection
|
rootElement = do_QueryInterface(focus);//set root to top of selection
|
||||||
|
Loading…
Reference in New Issue
Block a user