As a continuation of bug #103159, there are two other classes that have unneeded friend access level to RenderObject. RenderSVGContainer was the same case as RenderBox (an one liner patch, simply remove the friend keyword), but LayoutRepainter depended in a call to a protected virtual const function (outlineBoundsForRepaint()). This patch makes the const function public. I've looked also in the remaining classes that are friends of RenderObject, and have some comments with questions as follow below: a) RenderBlock (inherits indirectly from RenderObject) & RenderObjectChildList: they are going to be tricky since depend on calls to some protected members marked as 'dangerous to use!' (i.e. setters for siblings and the parent of the RenderObject). I assume that the approach used for one will work for the other... question: should they remain friends or shall we provide access to the setters via a proxy/bridge class? The second approach would at least keep in a central place the access to the protected/private members of RenderObject. Suggestions? b) RenderLayer whose access is due to an instance of RenderScrollbarPart, I feel this one will be easier to solve (since RenderScrollbarPart IIRC is a RenderBlock).
Created attachment 175843 [details] The patch v01
I suspect that having RenderLayer be the only possible caller of that function may have been part of the original intention. Still I think having it public is probably a better design. I've CC'd Simon in case he'd like to comment.
Eric Just to confirm, should I send another patch with previous changes *and* make RenderObject's functions (setPreviousSibling, setNextSibling, setParent) no longer protected? That would free the remaining classes from having friend access to RenderObject.
Comment on attachment 175843 [details] The patch v01 Please put the declaration for outlineBoundsForRepaint() just under rectWithOutlineForRepaint().
This patch is fine as is. I'm not sure it makes sense to make setPreviousSibling, etc. generically public, as those are dangerous functions. It's unclear why any code would need to access those anyway? Thanks for the patch.
Created attachment 176068 [details] Implementing reviewers suggestion (location of moved function) Now outlineBoundsForRepaint() follows just after rectWithOutlineForRepaint().
Comment on attachment 176068 [details] Implementing reviewers suggestion (location of moved function) Clearing flags on attachment: 176068 Committed r135779: <http://trac.webkit.org/changeset/135779>
All reviewed patches have been landed. Closing bug.