Closed Bug 240459 Opened 21 years ago Closed 15 years ago

copy and paste image creates new div

Categories

(SeaMonkey :: Composer, defect)

All
Windows XP
defect
Not set
major

Tracking

(Not tracked)

RESOLVED EXPIRED

People

(Reporter: boofy_bloke, Unassigned)

References

()

Details

(Keywords: testcase)

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7b) Gecko/20040316 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7b) Gecko/20040316 Here is the original HTML: <div id="image"><img src="images/around-the-world-in-80-days-poster.jpg" alt="Around the world in 80 days" title="Around the world in 80 days" height="350" width="250"></div> When I copy and paste in Normal view, Composer writes this HTML: <div id="image"> <div id="image"><img src="file:///D%7C/cia/reviews/a/images/around-the-world-in-80-days-poster.jpg" alt="Around the world in 80 days" title="Around the world in 80 days" height="350" width="250"> <div id="image"><img src="file:///D%7C/cia/reviews/a/images/around-the-world-in-80-days-poster.jpg" alt="Around the world in 80 days" title="Around the world in 80 days" height="350" width="250"> <div id="image"><img src="file:///D%7C/cia/reviews/a/images/around-the-world-in-80-days-poster.jpg" alt="Around the world in 80 days" title="Around the world in 80 days" height="350" width="250"></div> </div> </div> Reproducible: Always Steps to Reproduce: 1. 2. 3.
a) Can you create a *reduced* testcase out of the code you pasted? b) How do you actually select the node to copy? How do you make sure you are selecting the <img src="...80-days-poster.jpg"...> and that you are NOT selecting the wrapping div around it? c) How do you actually select the target node to paste into? d) Generally speaking, how do you copy and paste (the command you use)? From a document in a composer window to another document in a composer window? Generally speaking, the HTML Tags editing mode is easier, safer and more reliable for cut, copy, paste edition operations as one can better see which node(s) is(are) actually being edited from and to. I am able to copy an <img> inside a div from a Composer window to inside a div in another Composer window. WORKSFORME with Mozilla 1.8a3 build 2004080509 here. Maybe the behavior you describe is another side effect/consequence of bug 251686. Can you try again with a recent build? "be sure that you've reproduced your bug using a build released within the past three days. Our development process moves at lightning speed, and the bug you've found may already have been fixed." http://www.mozilla.org/quality/bug-writing-guidelines.html
Whiteboard: WORKSFORME
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a3) Gecko/20040805 I get this problem from Normal view. I select an image, CTRL+C, right arrow, CTRL+V. The image outline shows up but not the image itself. Here is the before code: <div id="image"><img src="../s/images/somersault-1.jpg" alt="Somersault (More than scarlet)" title="Somersault (More than scarlet)" height="230" width="350"></div> Here is the after code: <div id="image"><img src="../s/images/somersault-1.jpg" alt="Somersault (More than scarlet)" title="Somersault (More than scarlet)" height="230" width="350"> <div id="image"><img src="file:///D%7C/thecia/reviews/s/images/somersault-1.jpg" alt="Somersault (More than scarlet)" title="Somersault (More than scarlet)" height="230" width="350"></div> </div> Hope that helps. =8^)
Hardware: PC → All
First of all, thanks for getting back to me in this bugfile. How to select a node and how to select just the content of a node is crucial in this sort of bugfile. Often, one frequent difficulty of users is that they are trying to select a node nested inside a parent node and the interface does not react as the user expects. I'll give you steps to reproduce, the same steps I used when writing comment #1. 1- Copy and paste the following code <div id="idDiv"><img style="width: 209px; height: 99px;" alt="Mozilla logo" src="http://www.mozilla.org/images/mlogo.gif"><br> </div> inside, within the <body> </body> of a brand new Composer page. You need to be connected to the internet so that you can actually view that mlogo image. 2- Save the document under a name, say, bug240459.html 3- Make sure you have View/Show-Hide/Status Bar item checked and you can view the status bar which displays a linearized document node tree In Normal editing mode ---------------------- 4- To select the image, just left-click on the image. The image outline should show resizing handles (small white squares surrounding it) but the image should not be in reverse video, should not be highlighted. The status bar should show <img> highlighted (in reverse video). The status bar should NOT show <div> highlighted. 5- Then, Ctrl+C or click the Copy button in the Composition toolbar 6- Then, right-arrow to position the cursor right after the <img> 7- Then, Ctrl+V or click the Paste button in the Composition toolbar and you should get the 2 same images, side by side, inside that same, unique <div id="idDiv" ...> node. In HTML Tags editing mode ------------------------- 4- To select the image, just left-click on the yellow IMG icon. The image outline should show resizing handles (small white squares surrounding it) but the image should not be in reverse video, should not be highlighted. The status bar should show <img> highlighted (in reverse video). The status bar should NOT show <div> highlighted. Same steps 5- , 6- and 7 as Normal editing mode. If you want to copy the whole div, then you must choose accordingly the <div>, not just its content, the <img> and also, you need to choose another distinct, unique id attribute value because id attribute value must be document unique: http://www.w3.org/TR/html401/struct/global.html#adef-id From reading your comment #2, I see that you select the whole div, then copy and paste it just after the <img>. Using, trusting the linearized document node tree is one way to see what you are doing, where you are pasting the node (and what node: element node or text node). I think Composer documentation should be detailed, explicit on these operations. Get back to me on all this, whether this works for you or not. Thanks.
I think I wasn't clear enough. In Normal view I left click on the image to select it and the Status Bar shows <body> <div> *<img>* but when I arrow right and paste I get <body> <div> <div>. Even if I paste on top of the selected image I get <body> <div> <div>.
Craig, could you please give us clear steps for reproducing the bug, detailing everything you did to reproduce it (a vague summary isn't as effective as it's open to various interpretations). Please use the same format and level of detail as given in comment #3. Also give the user agent of the Mozilla build in which you're still able to reproduce the problem. Thanks.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a5) Gecko/20041002 I'm not sure how to provide more detail but I'll give it a go. The template page I use is viewable at http://thecia.com.au/reviews/=film.shtml. The relevant original HTML code is: <div id="image"><img src="../images/logo.gif" alt="+" title="+" height="100" width="100"></div> 1. Type CTRL+E to edit. 2. Scroll down to the bottom of the page. 3. Left click on the CIA logo image. 4. Type CTRL+C to copy. 5. Arrow left. 6. Type CTRL+V to paste. 7a. The pasted image appears *above* the original image. 7b. The HTML code changes to: <div id="image"> <div id="image"><img src="../images/logo.gif" alt="+" title="+" height="100" width="100"></div> <img src="../images/logo.gif" alt="+" title="+" height="100" width="100"></div> 8. The pasted image should appear *beside* the original and the HTML code should be: <div id="image"><img src="../images/logo.gif" alt="+" title="+" height="100" width="100"><img src="../images/logo.gif" alt="+" title="+" height="100" width="100"></div>
Tested against Mozilla 1.8a4 (build 2004092705) Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8a4) Gecko/20040927 The first time I attempted to reproduce this problem, I managed to get the expected results after following the steps in comment #3 for copying/pasting in normal editing mode. However, further attempts in both normal and HTML tags mode came up with the results as given by Matti in comment #6. The results are inconsistent, and pasting a copy of an image within the same div as the original image is too confusing. Although there is supposed to be a specific way of correctly performing this supposedly-trivial operation, ultimately it's not intuitive, and it's just plain confusing for regular users. Arguably, this qualifies as a bug. Confirming.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: WORKSFORME
If the code is <div><img><br> </div> then copying and pasting an image in the div will work (will give expected results). If the code is <div><img> </div> then copying and pasting an image in the div will NOT work (will bring actual results). Matti, you did not followed the steps I gave in comment #3.
Load this attachment, then File/Edit Page...Ctrl+E and then follow instructions in that page.
This bug is also happening on Nvu 0.50 (20041004)
Product: Browser → Seamonkey
Assignee: composer → nobody
QA Contact: composer
MASS-CHANGE: This bug report is registered in the SeaMonkey product, but has been without a comment since the inception of the SeaMonkey project. This means that it was logged against the old Mozilla suite and we cannot determine that it's still valid for the current SeaMonkey suite. Because of this, we are setting it to an UNCONFIRMED state. If you can confirm that this report still applies to current SeaMonkey 2.x nightly builds, please set it back to the NEW state along with a comment on how you reproduced it on what Build ID, or if it's an enhancement request, why it's still worth implementing and in what way. If you can confirm that the report doesn't apply to current SeaMonkey 2.x nightly builds, please set it to the appropriate RESOLVED state (WORKSFORME, INVALID, WONTFIX, or similar). If no action happens within the next few months, we move this bug report to an EXPIRED state. Query tag for this change: mass-UNCONFIRM-20090614
Status: NEW → UNCONFIRMED
MASS-CHANGE: This bug report is registered in the SeaMonkey product, but still has no comment since the inception of the SeaMonkey project 5 years ago. Because of this, we're resolving the bug as EXPIRED. If you still can reproduce the bug on SeaMonkey 2 or otherwise think it's still valid, please REOPEN it and if it is a platform or toolkit issue, move it to the according component. Query tag for this change: EXPIRED-20100420
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → EXPIRED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: