WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
91632
Web Inspector: extracting HighlightInfo from HighlightData in DOMNodeHighlighter
https://bugs.webkit.org/show_bug.cgi?id=91632
Summary
Web Inspector: extracting HighlightInfo from HighlightData in DOMNodeHighlighter
Sergey Rogulenko
Reported
2012-07-18 09:39:46 PDT
Extracting HighlightInfo from HighlightData in DOMNodeHighlighter.
Attachments
Patch
(18.67 KB, patch)
2012-07-18 10:46 PDT
,
Sergey Rogulenko
no flags
Details
Formatted Diff
Diff
Patch
(18.50 KB, patch)
2012-07-19 08:12 PDT
,
Sergey Rogulenko
no flags
Details
Formatted Diff
Diff
Patch
(20.99 KB, patch)
2012-07-30 09:31 PDT
,
Sergey Rogulenko
no flags
Details
Formatted Diff
Diff
Patch
(20.14 KB, patch)
2012-07-31 01:23 PDT
,
Sergey Rogulenko
no flags
Details
Formatted Diff
Diff
Patch
(21.96 KB, patch)
2012-08-01 01:58 PDT
,
Sergey Rogulenko
no flags
Details
Formatted Diff
Diff
Patch
(23.20 KB, patch)
2012-08-03 08:59 PDT
,
Sergey Rogulenko
no flags
Details
Formatted Diff
Diff
Patch
(23.16 KB, patch)
2012-08-06 02:00 PDT
,
Sergey Rogulenko
no flags
Details
Formatted Diff
Diff
Patch
(23.06 KB, patch)
2012-08-06 02:56 PDT
,
Sergey Rogulenko
pfeldman
: review-
Details
Formatted Diff
Diff
Show Obsolete
(6)
View All
Add attachment
proposed patch, testcase, etc.
Sergey Rogulenko
Comment 1
2012-07-18 10:46:19 PDT
Created
attachment 153043
[details]
Patch
Andrey Kosyakov
Comment 2
2012-07-19 03:27:54 PDT
Comment on
attachment 153043
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=153043&action=review
> Source/WebCore/inspector/DOMNodeHighlighter.cpp:538 > + if (highlightInfo) {
So we're clearing highlight when passed a null highlightInfo. Can we instead have a separate method for that?
> Source/WebCore/inspector/DOMNodeHighlighter.cpp:551 > + m_highlightData->highlightInfo = adoptPtr(new HighlightInfo(*highlightInfo));
Does highlightInfo member have to be a pointer?
> Source/WebCore/inspector/DOMNodeHighlighter.h:51 > +struct HighlightInfo {
HighlightInfo is too generic -- can we find a better name? HighlightConfig sounds like a slightly better match.
Sergey Rogulenko
Comment 3
2012-07-19 08:12:10 PDT
Created
attachment 153267
[details]
Patch
Sergey Rogulenko
Comment 4
2012-07-30 09:31:19 PDT
Created
attachment 155302
[details]
Patch
Alexander Pavlov (apavlov)
Comment 5
2012-07-30 12:43:29 PDT
Comment on
attachment 155302
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=155302&action=review
> Source/WebCore/inspector/DOMNodeHighlighter.cpp:497 > + if (m_needsUpdateBeforePainting)
Why did this appear? What issue does it solve?
> Source/WebCore/inspector/DOMNodeHighlighter.cpp:593 > + IntRect visibleRect = IntRect(IntPoint(), frame->view()->visibleContentRect().size());
What was wrong with the old visibleContentRect()? You can use frame->view()->visibleSize() for brevity.
> Source/WebCore/inspector/InspectorDOMAgent.cpp:1017 > + return PassOwnPtr<HighlightConfig> ();
Will "return 0;" work in this case, like it does for PassRefPtr's?
Sergey Rogulenko
Comment 6
2012-07-31 01:00:09 PDT
Comment on
attachment 155302
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=155302&action=review
>> Source/WebCore/inspector/DOMNodeHighlighter.cpp:497 >> + if (m_needsUpdateBeforePainting) > > Why did this appear? What issue does it solve?
When we scroll the page we do not repaint the whole view. So, if we do not do full repaint, there may appear multiple elementTitles on the screen. So I added this to force repainting of the whole overlay.
>> Source/WebCore/inspector/DOMNodeHighlighter.cpp:593 >> + IntRect visibleRect = IntRect(IntPoint(), frame->view()->visibleContentRect().size()); > > What was wrong with the old visibleContentRect()? > You can use frame->view()->visibleSize() for brevity.
The problem here could appear when you open a page, scroll down and press pause button. The position of visibleContentRect is (0, y), where y > 0, but the context is configured so that the upper-left corner is (0, 0). So the drawing rect would be painted below its proper place. Maybe it is better to do context.translate?
>> Source/WebCore/inspector/InspectorDOMAgent.cpp:1017 >> + return PassOwnPtr<HighlightConfig> (); > > Will "return 0;" work in this case, like it does for PassRefPtr's?
I tried return 0, but it didn't compile.
Pavel Feldman
Comment 7
2012-07-31 01:16:44 PDT
Comment on
attachment 155302
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=155302&action=review
> Source/WebCore/inspector/DOMNodeHighlighter.cpp:498 > + update();
re-validating screen from paint is a no-go.
Sergey Rogulenko
Comment 8
2012-07-31 01:23:16 PDT
Created
attachment 155462
[details]
Patch
Pavel Feldman
Comment 9
2012-07-31 06:43:39 PDT
Comment on
attachment 155462
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=155462&action=review
Looks mostly good, few nits inline.
> Source/WebCore/inspector/DOMNodeHighlighter.h:60 > +struct HighlightData {
1) I don't think you need highlight data type. 2) I think it is fine to have rect and node assigned at the same time
> Source/WebCore/inspector/InspectorDOMAgent.cpp:1016 > + if (!highlightInspectorObject)
This should never happen, you should return ErrorString for such cases,
> Source/WebCore/inspector/InspectorDOMAgent.cpp:1021 > + highlightInspectorObject->getBoolean("showInfo", &showInfo);
I believe we are generating constants for these.
Sergey Rogulenko
Comment 10
2012-08-01 00:25:17 PDT
Comment on
attachment 155462
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=155462&action=review
>> Source/WebCore/inspector/InspectorDOMAgent.cpp:1021 >> + highlightInspectorObject->getBoolean("showInfo", &showInfo); > > I believe we are generating constants for these.
I did not find constants for these (only setShowInfo, setContentColor and so on). Is it OK that InspectorTypeBuilder already has class HighlightConfig?
Sergey Rogulenko
Comment 11
2012-08-01 01:58:00 PDT
Created
attachment 155757
[details]
Patch
Pavel Feldman
Comment 12
2012-08-02 12:05:42 PDT
Comment on
attachment 155757
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=155757&action=review
Looks good. A couple of nits inline.
> Source/WebCore/inspector/DOMNodeHighlighter.cpp:565 > + if (!m_highlightNode && !m_highlightRect)
I think now node and rect highlighting are independent first class citizens. You should treat them separately (as you treat drawPausedInDebugger)
> Source/WebCore/inspector/InspectorDOMAgent.cpp:1009 > + *errorString = "Null pointer for highlightInspectorObject in InspectorDOMAgent::setSearchingForNode";
"Internal error: highlight configuration parameter is missing"
Sergey Rogulenko
Comment 13
2012-08-03 08:59:33 PDT
Created
attachment 156393
[details]
Patch
Pavel Feldman
Comment 14
2012-08-03 09:30:46 PDT
Comment on
attachment 156393
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=156393&action=review
> Source/WebCore/inspector/InspectorDOMAgent.cpp:1009 > + *errorString = "Null pointer for highlightInspectorObject in InspectorDOMAgent::setSearchingForNode";
I think I was commenting on this earlier.
> Source/WebCore/inspector/InspectorDOMAgent.cpp:1054 > + *errorString = "Null pointer for highlightInspectorObject in InspectorDOMAgent::highlightNode";
ditto
Sergey Rogulenko
Comment 15
2012-08-06 02:00:13 PDT
Created
attachment 156627
[details]
Patch
Pavel Feldman
Comment 16
2012-08-06 02:29:10 PDT
Comment on
attachment 156627
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=156627&action=review
> Source/WebCore/inspector/InspectorDOMAgent.cpp:1053 > + if (!highlightInspectorObject) {
I think you could move this code into highlightConfigFromInspectorObject(errorString, ...)
Sergey Rogulenko
Comment 17
2012-08-06 02:56:34 PDT
Created
attachment 156641
[details]
Patch
WebKit Review Bot
Comment 18
2012-08-06 03:20:08 PDT
Comment on
attachment 156627
[details]
Patch Clearing flags on attachment: 156627 Committed
r124749
: <
http://trac.webkit.org/changeset/124749
>
WebKit Review Bot
Comment 19
2012-08-06 03:20:14 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug