WebKit engine bug and safari4 beta major bug

Source: Internet
Author: User

I wrote the segment script two days ago. After adding float to a layer, I forgot to remove it. I directly used the script to change it to the absolute position: absolute and then set the coordinates...

Then Register The onclick event for the document object to trigger the display and hide the layer... so that safari3 and chrome will crash. safari4 has not been tested and does not know whether the bug still exists.

At that time, I found that as long as I clicked the mouse, I collapsed and thought it was a registration event issue .. I canceled the registered document. onclick event listening and then manuallyCodeRepeatedly calling this layer show hidden won't crash ....

I suddenly found that this problem would not occur if I removed the original brother Div of the layer in HTML. After repeated tests, I found the bug as follows:

When a div is floating and its brother node is a block element. if the DIV is not removed from the floating state, the DIV is set to absolute positioning, and then the browser event is used to call back the display and hiding of the layer... the WebKit engine (testing safari3 and chrome) will crash because it cannot figure out how to render the relationship between the layer and its brother Block Element !!!

So we only need to remember to set an element to absolute positioning before we can see if it has floating, if there is, we need to clear it...

Let's talk about the safari4 beta issue.

The following code is used in the function body:

Try {

Return OBJ;

}

Finally {

OBJ = NULL;

}

Both JS and C # Will return OBJ normally, and because we finally point OBJ to null, the closure will be reclaimed immediately, instead of extending its lifetime due to external references.

But this code is invalid in safari4. If so, null is returned ..

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.