Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 6476185965953024: Adjust the size of the bubble to the size of its content in Safari (Closed)

Created:
Dec. 24, 2013, 12:42 p.m. by Sebastian Noack
Modified:
Jan. 16, 2014, 11:39 a.m.
Visibility:
Public.

Description

Safari doesn't adjust the size of the popover automatically to the size of its content. So currently the size of the bubble is hard-coded in metadata.safari, and when you collapse the ad counter the bubble will have a large empty area. However it is possible to change the size of the bubble programatically. So I have added a listener for DOMSubtreeModified that adjust the size of the bubble to its content.

Patch Set 1 #

Total comments: 2

Patch Set 2 : Rebased and fixed some issues #

Total comments: 2

Patch Set 3 : Adressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -4 lines) Patch
M metadata.safari View 1 1 chunk +0 lines, -4 lines 0 comments Download
M safari/ext/popup.js View 1 2 1 chunk +27 lines, -0 lines 0 comments Download

Messages

Total messages: 6
Sebastian Noack
Dec. 24, 2013, 12:49 p.m. (2013-12-24 12:49:07 UTC) #1
Wladimir Palant
LGTM but please answer my answer below. http://codereview.adblockplus.org/6476185965953024/diff/5629499534213120/safari/ext/popup.js File safari/ext/popup.js (right): http://codereview.adblockplus.org/6476185965953024/diff/5629499534213120/safari/ext/popup.js#newcode31 safari/ext/popup.js:31: safari.self.height = ...
Jan. 15, 2014, 3:47 p.m. (2014-01-15 15:47:13 UTC) #2
Sebastian Noack
I also did following changes: * Used WebkitMutationObserver when available. The DOMSubtreeModified event isn't only ...
Jan. 15, 2014, 5:21 p.m. (2014-01-15 17:21:45 UTC) #3
Sebastian Noack
http://codereview.adblockplus.org/6476185965953024/diff/5629499534213120/safari/ext/popup.js File safari/ext/popup.js (right): http://codereview.adblockplus.org/6476185965953024/diff/5629499534213120/safari/ext/popup.js#newcode31 safari/ext/popup.js:31: safari.self.height = document.body.offsetHeight; On 2014/01/15 15:47:13, Wladimir Palant wrote: ...
Jan. 15, 2014, 5:21 p.m. (2014-01-15 17:21:52 UTC) #4
Wladimir Palant
http://codereview.adblockplus.org/6476185965953024/diff/5724160613416960/safari/ext/popup.js File safari/ext/popup.js (right): http://codereview.adblockplus.org/6476185965953024/diff/5724160613416960/safari/ext/popup.js#newcode27 safari/ext/popup.js:27: if ("WebKitMutationObserver" in window) We should go for the ...
Jan. 16, 2014, 7:55 a.m. (2014-01-16 07:55:59 UTC) #5
Sebastian Noack
Jan. 16, 2014, 11 a.m. (2014-01-16 11:00:31 UTC) #6
http://codereview.adblockplus.org/6476185965953024/diff/5724160613416960/safa...
File safari/ext/popup.js (right):

http://codereview.adblockplus.org/6476185965953024/diff/5724160613416960/safa...
safari/ext/popup.js:27: if ("WebKitMutationObserver" in window)
On 2014/01/16 07:55:59, Wladimir Palant wrote:
> We should go for the standardized name first, future Safari versions should
> support it. Maybe like this:
> 
>     if ("MutationObserver" in window || "WebKitMutationObserver" in window)
>     {
>       var observer = new (window.MutationObserver
> || window.WebKitMutationObserver)(updateSize);
>       ...
> 
> Style nit: please put curly brackets around multiline blocks even if they
> consist of only one statement - readability suffers otherwise.

Done.

Powered by Google App Engine
This is Rietveld