Closed
Bug 386496
Opened 18 years ago
Closed 18 years ago
Clicking on link in designMode document does follow that link now
Categories
(Core :: DOM: Editor, defect)
Core
DOM: Editor
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha8
People
(Reporter: martijn.martijn, Assigned: peterv)
References
()
Details
(Keywords: regression, testcase)
Attachments
(3 files, 1 obsolete file)
18.82 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
18.52 KB,
patch
|
Details | Diff | Splinter Review | |
2.68 KB,
patch
|
Details | Diff | Splinter Review |
See testcase, when clicking on the link, you should not be going to google.com.
I think this regressed with bug 237964.
Assignee | ||
Updated•18 years ago
|
Assignee: nobody → peterv
Assignee | ||
Comment 1•18 years ago
|
||
I don't really like spreading out the IsEditable checking for links like this, but it makes some sense (avoids us doing a bunch of things for links that won't work).
Assignee | ||
Updated•18 years ago
|
Attachment #270622 -
Flags: superreview?(bzbarsky)
Attachment #270622 -
Flags: review?(bzbarsky)
![]() |
||
Comment 2•18 years ago
|
||
Uh... so what it the testcase, exactly?
Reporter | ||
Comment 3•18 years ago
|
||
Sorry, I used the testcase from bug 287707 for that.
![]() |
||
Comment 4•18 years ago
|
||
I'm not sure I follow the main point of this patch. Why do the IsEditable() checks need to be hoisted out of webshell?
For the rest, I think we should indeed be checking for editability in nsObjectFrame one way or another.
Is there a reason the new nsIContent method is non-virtual? And non-hidden? In particular, should it just be a static nsContentUtils method taking a principal as the first arg instead of being a member method, if the only use of |this| is for the principal?
Flags: blocking1.9?
Assignee | ||
Comment 5•18 years ago
|
||
(In reply to comment #4)
> I'm not sure I follow the main point of this patch. Why do the IsEditable()
> checks need to be hoisted out of webshell?
They don't really need to move to fix this bug, but I didn't think they were in the right place in webshell. Plus, it seems like we can avoid running some code in the callers. For example, I don't think we should do the security check in TriggerLink if the node is editable.
> For the rest, I think we should indeed be checking for editability in
> nsObjectFrame one way or another.
Ok. I think we should actually stop plugins when they're contentEditable, which probably fixes the problem too.
> Is there a reason the new nsIContent method is non-virtual? And non-hidden?
> In particular, should it just be a static nsContentUtils method taking a
> principal as the first arg instead of being a member method, if the only use of
> |this| is for the principal?
Yes, that makes sense.
Status: NEW → ASSIGNED
![]() |
||
Comment 6•18 years ago
|
||
So what part of the patch actually fixes this bug?
Assignee | ||
Comment 7•18 years ago
|
||
The main fix is checking HasFlag(NODE_IS_EDITABLE) on the document, that means the document is in design mode. We used to just check HasFlag(NODE_IS_EDITABLE) on the node, but that just checks if the node is contentEditable. I'll add a comment to the IsEditable function to explain that.
Assignee | ||
Comment 8•18 years ago
|
||
Let me know if you prefer me to just do s/aContent->HasFlag(NODE_IS_EDITABLE)/aContent->IsEditable()/ in nsWebShell.
Attachment #270622 -
Attachment is obsolete: true
Attachment #271232 -
Flags: superreview?(bzbarsky)
Attachment #271232 -
Flags: review?(bzbarsky)
Attachment #270622 -
Flags: superreview?(bzbarsky)
Attachment #270622 -
Flags: review?(bzbarsky)
![]() |
||
Comment 9•18 years ago
|
||
Comment on attachment 271232 [details] [diff] [review]
v1.1
>Index: content/base/public/nsContentUtils.h
>+ * security check using aNode's principal.
aContent's, right?
>+ * @param aPresContext the pres context.
Document that this must be non-null and assert that in TriggerLink's implementation?
Also document that the URI must be non-null.
>+ * @param aClick whether this was a click or not (if false, it assumes you
"this method assumes you"
>Index: content/base/public/nsINode.h
>+ PRBool IsEditable() const;
Should this be virtual? Or at least inline and expanding to either a virtual IsEditableExternal() or a non-virtual IsEditableInternal?
Or do we not expect anyone outside gklayout to call this?
>Index: content/base/src/nsContentUtils.cpp
>+ nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager();
You can nix the "nsContentUtils::" part. Or just use sSecurityManager directly.
>Index: docshell/base/nsWebShell.cpp
I'd be happier with the IsEditable() calls here. Belt and braces, and this is not exactly a critical path...
r+sr=bzbarsky with the nits picked.
Attachment #271232 -
Flags: superreview?(bzbarsky)
Attachment #271232 -
Flags: superreview+
Attachment #271232 -
Flags: review?(bzbarsky)
Attachment #271232 -
Flags: review+
Assignee | ||
Comment 10•18 years ago
|
||
Assignee | ||
Comment 11•18 years ago
|
||
Assignee | ||
Updated•18 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Flags: blocking1.9? → in-testsuite+
OS: Windows XP → All
Hardware: PC → All
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9beta1
You need to log in
before you can comment on or make changes to this bug.
Description
•