Bug 75097 - Need a function to expose m_visuallyNoEmptyCharacterCount in FrameView.
Summary: Need a function to expose m_visuallyNoEmptyCharacterCount in FrameView.
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-22 10:42 PST by Yongjun Zhang
Modified: 2012-04-19 15:02 PDT (History)
1 user (show)

See Also:


Attachments
Add function visuallyNonEmptyCharactersCount to return the number of visually non-empty characters from FrameView. (2.23 KB, patch)
2011-12-22 11:44 PST, Yongjun Zhang
eric: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yongjun Zhang 2011-12-22 10:42:54 PST
We need to have a function to expose m_visuallyNoEmptyCharacterCount in FrameView.  That information would be useful to check how many RenderText characters are available in a page, for example.
Comment 1 Yongjun Zhang 2011-12-22 11:44:44 PST
Created attachment 120355 [details]
Add function visuallyNonEmptyCharactersCount to return the number of visually non-empty characters from FrameView.
Comment 2 Sam Weinig 2011-12-23 14:54:32 PST
Comment on attachment 120355 [details]
Add function visuallyNonEmptyCharactersCount to return the number of visually non-empty characters from FrameView.

View in context: https://bugs.webkit.org/attachment.cgi?id=120355&action=review

> Source/WebCore/ChangeLog:3
> +        Need a function to expose m_visuallyNoEmptyCharacterCount in FrameView. 

I think you mean m_visuallyNonEmptyCharacterCount.

> Source/WebCore/ChangeLog:16
> +        the page is already visually no empty.  The value is reset at FrameView::reset().

Typo. no -> non.

> Source/WebCore/page/FrameView.h:-507
> +    m_visuallyNonEmptyCharacterCount += count;
>      if (m_isVisuallyNonEmpty)
>          return;
> -    m_visuallyNonEmptyCharacterCount += count;

If we are incrementing this count even after becoming visually non-empty, I am not sure the variable name makes sense any more.
Comment 3 Yongjun Zhang 2012-01-03 09:38:49 PST
(In reply to comment #2)
> (From update of attachment 120355 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=120355&action=review
> 
> > Source/WebCore/ChangeLog:3
> > +        Need a function to expose m_visuallyNoEmptyCharacterCount in FrameView. 
> 
> I think you mean m_visuallyNonEmptyCharacterCount.
> 
> > Source/WebCore/ChangeLog:16
> > +        the page is already visually no empty.  The value is reset at FrameView::reset().
> 
> Typo. no -> non.
> 
> > Source/WebCore/page/FrameView.h:-507
> > +    m_visuallyNonEmptyCharacterCount += count;
> >      if (m_isVisuallyNonEmpty)
> >          return;
> > -    m_visuallyNonEmptyCharacterCount += count;
> 
> If we are incrementing this count even after becoming visually non-empty, I am not sure the variable name makes sense any more.

Yeah, these characters are always visually non-empty no matter when the page becomes visually non-empty or not.   How about change the variable name to be m_renderedCharacterCount?
Comment 4 Yongjun Zhang 2012-01-03 09:39:02 PST
<rdar://problem/9209360>
Comment 5 Eric Seidel (no email) 2012-04-19 15:02:24 PDT
Comment on attachment 120355 [details]
Add function visuallyNonEmptyCharactersCount to return the number of visually non-empty characters from FrameView.

It looks like Sam was saying "please upload a new patch". :)