Open
Bug 518711
Opened 15 years ago
Updated 2 years ago
break up nsHTMLDocument::StartDocumentLoad
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
NEW
People
(Reporter: sayrer, Unassigned)
References
Details
Attachments
(1 file, 3 obsolete files)
13.71 KB,
patch
|
sicking
:
review+
sicking
:
superreview+
|
Details | Diff | Splinter Review |
This method is difficult to refactor because it's really long and complicated.
Reporter | ||
Comment 1•15 years ago
|
||
Assignee: nobody → sayrer
Reporter | ||
Updated•15 years ago
|
Attachment #402702 -
Flags: superreview?(jst)
Attachment #402702 -
Flags: review?(jst)
Reporter | ||
Updated•15 years ago
|
Attachment #402702 -
Flags: superreview?(jst)
Attachment #402702 -
Flags: review?(jst)
Reporter | ||
Comment 2•15 years ago
|
||
Comment on attachment 402702 [details] [diff] [review]
break it up
actually, this is going to be full of nits -- need to use content/ style. fix in a bit.
Reporter | ||
Comment 4•15 years ago
|
||
Reporter | ||
Updated•15 years ago
|
Summary: break up first bit of nsHTMLDocument::StartDocumentLoad → break up nsHTMLDocument::StartDocumentLoad
Reporter | ||
Updated•15 years ago
|
Attachment #402868 -
Flags: superreview?(jonas)
Attachment #402868 -
Flags: review?(jonas)
Reporter | ||
Updated•15 years ago
|
Attachment #402702 -
Attachment is obsolete: true
Comment on attachment 402868 [details] [diff] [review]
break it up
>diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp
> if (!(contentType.EqualsLiteral("text/html") && aCommand && !nsCRT::strcmp(aCommand, "view"))) {
> loadAsHtml5 = PR_FALSE;
> }
>-#ifdef DEBUG
>- else {
>- NS_ASSERTION(mIsRegularHTML,
>- "Hey, someone forgot to reset mIsRegularHTML!!!");
>- }
>-#endif
>-
>+
>+ #ifdef DEBUG
>+ else {
>+ NS_ASSERTION(mIsRegularHTML,
>+ "Hey, someone forgot to reset mIsRegularHTML!!!");
>+ }
>+ #endif
The old location and indentation seemed better here. In general, separating the |else| from the |if| is a bad idea.
> CSSLoader()->SetCaseSensitive(!IsHTML());
> CSSLoader()->SetCompatibilityMode(mCompatMode);
>
>- PRBool needsParser = PR_TRUE;
>- if (aCommand)
>- {
>- if (!nsCRT::strcmp(aCommand, "view delayedContentLoad")) {
>- needsParser = PR_FALSE;
>- }
>- }
>-
>+ return loadAsHtml5;
>+}
>+
>+already_AddRefed<nsICacheEntryDescriptor>
>+nsHTMLDocument::InitCacheDescriptor(nsIChannel* aChannel)
Can you make this a static helper function, not living on the nsHTMLDocument class?
r/sr=me
Attachment #402868 -
Flags: superreview?(jonas)
Attachment #402868 -
Flags: superreview+
Attachment #402868 -
Flags: review?(jonas)
Attachment #402868 -
Flags: review+
Reporter | ||
Comment 6•15 years ago
|
||
this asserts that the content sink isn't consuming data somewhere, looking into it
Reporter | ||
Comment 7•15 years ago
|
||
The problem was that I needed to invert the check for parser creation, after removing the "needsParser" variable.
Attachment #402868 -
Attachment is obsolete: true
Attachment #404511 -
Attachment is obsolete: true
Reporter | ||
Updated•15 years ago
|
Attachment #404525 -
Flags: superreview?(jonas)
Attachment #404525 -
Flags: review?(jonas)
Reporter | ||
Comment 8•15 years ago
|
||
review ping
Comment on attachment 404525 [details] [diff] [review]
works, addresses comments
>+nsHTMLDocument::SetupParseMode(const char* aCommand, nsIChannel* aChannel,
> if (!(contentType.EqualsLiteral("text/html") && aCommand && !nsCRT::strcmp(aCommand, "view"))) {
> loadAsHtml5 = PR_FALSE;
> }
>-#ifdef DEBUG
>- else {
>- NS_ASSERTION(mIsRegularHTML,
>- "Hey, someone forgot to reset mIsRegularHTML!!!");
>- }
>-#endif
>-
>+
>+ #ifdef DEBUG
>+ else {
>+ NS_ASSERTION(mIsRegularHTML,
>+ "Hey, someone forgot to reset mIsRegularHTML!!!");
>+ }
>+ #endif
>+
I'd still prefer not to make this change. It seems bad for all sorts of reasons.
r/sr=me with that reverted.
Attachment #404525 -
Flags: superreview?(jonas)
Attachment #404525 -
Flags: superreview+
Attachment #404525 -
Flags: review?(jonas)
Attachment #404525 -
Flags: review+
Comment 10•14 years ago
|
||
Was this ever checked in, and if not, why not?
Comment 11•13 years ago
|
||
Yearly ping
Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
Reporter | ||
Updated•5 years ago
|
Assignee: sayrer → nobody
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•