Commit 054c1d9b authored by mrowe@apple.com's avatar mrowe@apple.com

Fix 60 crashes seen on the buildbots that were misreported as hangs.

Reviewed by Dan Bernstein.

* dom/Document.cpp:
(WebCore::Document::detachNodeIterator): Null-check page() before dereferencing it.
(WebCore::Document::nodeWillBeRemoved): Ditto.
(WebCore::Document::textInserted): Ditto.
(WebCore::Document::textNodesMerged): Ditto.
(WebCore::Document::textRemoved): Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32901 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent fa23f6e5
2008-05-05 Mark Rowe <mrowe@apple.com>
Reviewed by Dan Bernstein.
Fix 60 crashes seen on the buildbots that were misreported as hangs.
* dom/Document.cpp:
(WebCore::Document::detachNodeIterator): Null-check page() before dereferencing it.
(WebCore::Document::nodeWillBeRemoved): Ditto.
(WebCore::Document::textInserted): Ditto.
(WebCore::Document::textNodesMerged): Ditto.
(WebCore::Document::textRemoved): Ditto.
2008-05-05 Brady Eidson <beidson@apple.com>
Reviewed by Mitz Pettel RTL
......@@ -2494,7 +2494,7 @@ void Document::detachNodeIterator(NodeIterator *ni)
void Document::nodeChildrenChanged(ContainerNode* container)
{
if (!page()->settings()->rangeMutationDisabledForOldAppleMail()) {
if (!page() || !page()->settings()->rangeMutationDisabledForOldAppleMail()) {
HashSet<Range*>::const_iterator end = m_ranges.end();
for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; ++it)
(*it)->nodeChildrenChanged(container);
......@@ -2507,7 +2507,7 @@ void Document::nodeWillBeRemoved(Node* n)
for (HashSet<NodeIterator*>::const_iterator it = m_nodeIterators.begin(); it != nodeIteratorsEnd; ++it)
(*it)->nodeWillBeRemoved(n);
if (!page()->settings()->rangeMutationDisabledForOldAppleMail()) {
if (!page() || !page()->settings()->rangeMutationDisabledForOldAppleMail()) {
HashSet<Range*>::const_iterator rangesEnd = m_ranges.end();
for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != rangesEnd; ++it)
(*it)->nodeWillBeRemoved(n);
......@@ -2521,7 +2521,7 @@ void Document::nodeWillBeRemoved(Node* n)
void Document::textInserted(Node* text, unsigned offset, unsigned length)
{
if (!page()->settings()->rangeMutationDisabledForOldAppleMail()) {
if (!page() || !page()->settings()->rangeMutationDisabledForOldAppleMail()) {
HashSet<Range*>::const_iterator end = m_ranges.end();
for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; ++it)
(*it)->textInserted(text, offset, length);
......@@ -2533,7 +2533,7 @@ void Document::textInserted(Node* text, unsigned offset, unsigned length)
void Document::textRemoved(Node* text, unsigned offset, unsigned length)
{
if (!page()->settings()->rangeMutationDisabledForOldAppleMail()) {
if (!page() || !page()->settings()->rangeMutationDisabledForOldAppleMail()) {
HashSet<Range*>::const_iterator end = m_ranges.end();
for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; ++it)
(*it)->textRemoved(text, offset, length);
......@@ -2546,7 +2546,7 @@ void Document::textRemoved(Node* text, unsigned offset, unsigned length)
void Document::textNodesMerged(Text* oldNode, unsigned offset)
{
if (!page()->settings()->rangeMutationDisabledForOldAppleMail()) {
if (!page() || !page()->settings()->rangeMutationDisabledForOldAppleMail()) {
NodeWithIndex oldNodeWithIndex(oldNode);
HashSet<Range*>::const_iterator end = m_ranges.end();
for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; ++it)
......@@ -2558,7 +2558,7 @@ void Document::textNodesMerged(Text* oldNode, unsigned offset)
void Document::textNodeSplit(Text* oldNode)
{
if (!page()->settings()->rangeMutationDisabledForOldAppleMail()) {
if (!page() || !page()->settings()->rangeMutationDisabledForOldAppleMail()) {
HashSet<Range*>::const_iterator end = m_ranges.end();
for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; ++it)
(*it)->textNodeSplit(oldNode);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment