Web Inspector: Show Selector's Specificity
https://bugs.webkit.org/show_bug.cgi?id=138189

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-11-03
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/protocol/CSS.json:
Create a new named type CSSSelector to include a selector's text and specificity.
The specificity tuple is optional as it may soon be made dynamic in some cases.

Source/WebCore:

Test: inspector/css/selector-specificity.html

* css/CSSSelector.h:
Remove very stale comment. '*' is a starAtom now instead of a special -1 tag.
Made the specificity masks public class constants.

* inspector/InspectorStyleSheet.h:
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::buildArrayForComputedStyle):
(WebCore::InspectorStyle::styleWithProperties):
(WebCore::InspectorStyleSheet::buildObjectForStyleSheetInfo):
Drive by use release() in some cases to reduce ref count churn.

(WebCore::buildObjectForSelectorHelper):
(WebCore::selectorsFromSource):
(WebCore::InspectorStyleSheet::buildObjectForSelector):
(WebCore::InspectorStyleSheet::buildObjectForSelectorList):
Build CSSSelector objects for SelectorLists.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:
* UserInterface/Test.html:
Add new files and strings.

* UserInterface/Models/CSSMedia.js:
Constructor functions are not needed, remove unnecessary code.

* UserInterface/Models/CSSRule.js:
(WebInspector.CSSRule.prototype.set selectors): Deleted.
This was unused and is no longer correct.

(WebInspector.CSSRule.prototype.get matchedSelectorText):
Update now that selectors are a list of objects, not just strings.

* UserInterface/Models/CSSSelector.js:
(WebInspector.CSSSelector):
(WebInspector.CSSSelector.prototype.get specificity):
New model object for protocol type CSS.CSSSelector.

* UserInterface/Models/DOMNodeStyles.js:
(WebInspector.DOMNodeStyles.prototype._parseSelectorListPayload.return):
(WebInspector.DOMNodeStyles.prototype._parseSelectorListPayload):
(WebInspector.DOMNodeStyles.prototype._parseRulePayload):
Handle parsing old and new SelectorLists.

* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection.prototype.refresh.appendSelector):
(WebInspector.CSSStyleDeclarationSection.prototype.refresh.appendSelectorText):
(WebInspector.CSSStyleDeclarationSection.prototype.refresh):
Update the code now that the list of selectors are model objects instead
of just selector text strings.

LayoutTests:

* inspector/css/matched-style-properties.html:
* inspector/css/selector-specificity-expected.txt: Added.
* inspector/css/selector-specificity.html: Copied from LayoutTests/inspector/css/matched-style-properties.html.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175483 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use FrameSnapshotting functions in FindController::getFindIndicatorBitmap
https://bugs.webkit.org/show_bug.cgi?id=138300
<rdar://problem/18855863>

Reviewed by Simon Fraser.

Share more code by using WebCore's FrameSnapshotting::snapshotSelection
in FindController instead of copying it into FindController wholesale.

* WebProcess/WebPage/FindController.cpp:
(WebKit::getFindIndicatorBitmap):
Make getFindIndicatorBitmap static, rename it from getFindIndicatorBitmapAndRect,
and drop the rect argument because only one caller wanted it, and we no longer need
to compute it (this happens in WebCore now).

Use snapshotSelection; all of the removed paint behaviors get added by
code in or underneath snapshotSelection now.

Draw the snapshot into our ShareableBitmap; we could avoid this in a future patch
by refactoring the FrameSnapshotting functions to take GraphicsContexts.

(WebKit::FindController::getImageForFindMatch):
(WebKit::FindController::updateFindIndicator):
Adopt the new getFindIndicatorBitmap.

* WebProcess/WebPage/FindController.h:
Remove getFindIndicatorBitmap(AndRect), which is now static.

* WebCore.exp.in:
* page/FrameSnapshotting.cpp:
(WebCore::snapshotSelection):
Move knowledge that selectionBounds can be empty down to WebCore.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderCounter shouldn't need a pre-destructor hook.
<https://webkit.org/b/138316>

Reviewed by Antti Koivisto.

RenderCounter will automatically register/unregister itself with
the RenderView when constructed/destroyed.

It was using a willBeDestroyed() hook because it used to be that you
couldn't get to the RenderView in the destructor. That's no longer
an issue as Document promises that RenderView is the last render tree
node to go away.

* rendering/RenderCounter.cpp:
(WebCore::RenderCounter::~RenderCounter):
(WebCore::RenderCounter::willBeDestroyed): Deleted.
* rendering/RenderCounter.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
_actionMenuItemsForHitTestResult is given kWKActionMenuLink but an empty array of defaultMenuItems
https://bugs.webkit.org/show_bug.cgi?id=138321
<rdar://problem/18855134>

Reviewed by Beth Dakin.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _defaultMenuItemsForLink]):
(-[WKActionMenuController _defaultMenuItems:]):
Move the HTTP-family-URLs-only condition to the place where we decide what kind of menu to
show. We depend on _defaultMenuItemsForLink returning the link menu, and should never
set the link menu type if we aren't going to build a link menu.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175486 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Support modern range loops over CSSValueList
https://bugs.webkit.org/show_bug.cgi?id=138285

Reviewed by Andreas Kling.

Add support for modern range loops over CSSValueList objects.
Port the code base to using range loops for CSSValueList objects and
drop the CSSValueListInspector / CSSValueListIterator classes as they
are no longer needed.

No new tests, no behavior change.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175487 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (Subpixel layout): Bubbles don't fit in Bugzilla review page
https://bugs.webkit.org/show_bug.cgi?id=138323

Reviewed by Zalan Bujtas.

* QueueStatusServer/templates/statusbubble.html: Round the sizes up, not down.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175488 268f45cc-cd09-0410-ab3c-d52691b4dbfc