Comments (15)
I cannot reproduce it. I see the word highlighted and correct scroll:
http://www.2shared.com/file/10426157/bbbbc790/taf-shot1.html
please report with screenshot (if possible on a lighter page)
Original comment by tokland
on 3 Jan 2010 at 4:03
from chrome-type-ahead.
You can see my screenshot attached.
I´ve discovered the problem!
It´s because I use zoomed pages at 125%.
It´s likely you need to multiply the position by the zoom level.
I use the extension AutoZoom for setting the default level.
Original comment by [email protected]
on 3 Jan 2010 at 5:34
from chrome-type-ahead.
Oh, ok. This seems a pretty nice extension, but the way it changes zooms fools
JS scripts. With JS there is no
zoom factor, you only ask position for elements to the DOM and it responds
correctly, with the current zoom
applied. But when the extension changes the zoom the DOM returns inaccurate
values.
How to test:
function getElementPosition(element) {
var width = element.offsetWidth;
var height = element.offsetHeight;
var selectedPosX = 0;
var selectedPosY = 0;
while(element) {
selectedPosX += element.offsetLeft;
selectedPosY += element.offsetTop;
element = element.offsetParent;
}
return {x: selectedPosX, y: selectedPosY, width: width, height: height};
}
Use this function with an element. Modify zoom (standard way). See how
positions are logical. Do the same but
using the extension. See how returned vales are not good.
You can ask the extension developer, if the problem is in my getElementPosition
code I'll change it.
Original comment by tokland
on 3 Jan 2010 at 6:06
from chrome-type-ahead.
As you described, it seems to be a bug of Chrome, not the AutoZoom level.
Can´t you get the actual zoom level and force a multiplication of it by the
selectedPosY for determining the correct scrolling position?
Original comment by [email protected]
on 3 Jan 2010 at 7:16
from chrome-type-ahead.
- To change zoom level in chrome (real-time): document.body.style.zoom = "150%"
- Changing the zoom level that way everything seems ok.
- See zoom.js in autozoom. It uses document.body.style.zoom, but in my tests
getElementPosition
returned weird positions. Example: Get position of any element with a given
zoom level, then ctrl+]
and ctrl+[, get position again, you get a bigger number. Do it again, you get a
bigger number. And so
on...
As I see it, there is something wrong with the extension.
Original comment by tokland
on 3 Jan 2010 at 7:53
from chrome-type-ahead.
Another test:
- Change zoom with Autozoom
- Press link 'My favorites' (up-right on this page)
- Menu appears in wrong possition
Original comment by tokland
on 3 Jan 2010 at 9:04
from chrome-type-ahead.
There is another extension called ZOOMY that has the same function of Autozoom.
The compatibily problem with Type-Ahead also happens with this other extension.
Original comment by [email protected]
on 3 Jan 2010 at 10:56
from chrome-type-ahead.
Can you do the "my favorites" test with both of them?
Original comment by tokland
on 3 Jan 2010 at 10:59
from chrome-type-ahead.
Oh, sure, I forgot to tell you: there is no wrong position of "My favorites"
when I
zoom the page with Autozoom or Zoomy (see the attachment)
Original comment by [email protected]
on 3 Jan 2010 at 11:05
Attachments:
from chrome-type-ahead.
I restarted chrome and now the menu's working well.
However, the main problem remains: element positions returned by the DOM after
autozoom changes are just chaotic. I'll try to create an HTML+JS so you can
test in
Windows.
Original comment by tokland
on 3 Jan 2010 at 11:45
from chrome-type-ahead.
More:
- AFAIK chrome standard zoom is not accessible in any way from JS.
- element positions are well adjusted when standard zoom changes.
- document.body.style.zoom is the way autozoom changes zoom level.
- element positions are not adjusted when document.body.style.zoom changes.
- FF does nothing when you change document.body.style.zoom, so we cannot
compare.
I uploaded a HTML to test (100% ok, 150% fails):
http://tokland.freehostia.com/test-zoom.html
As I see it, it makes no sense that JS code has to apply corrections checking
zoom levels.
I think element positions should change when style.zoom changes. I'd say it is
a problem with Webkit.
Original comment by tokland
on 4 Jan 2010 at 1:08
from chrome-type-ahead.
Thanks very much for you attention and efford to fix this problem.
Your uploaded html is awesome and proves that the problem is really with
Webkit. I´ve
made a small change to its code (I created a global variable called "newvalue"
and it
´s the same value as the variable "value". The scrolling then multiplies the
newvalue
with the Y position of the element).
See the attached file.
I know it´s a bad workaround but, believe on me, it´s much easier than
convincing
someone of the Chrome team to fix the problem with Webkit.
Original comment by [email protected]
on 4 Jan 2010 at 2:19
Attachments:
from chrome-type-ahead.
I am no JS expert, so testing those kinds of things is a good way to learn.
Not being really sure if applying zoom level is DOM's responsibility, for now
I've modified the
extension (r87). I only check zoom in body, not the elements tree.
Anyway it would be great if you can report Chromium (or Webkit?) developers.
Using test-
zoom.html is very easy to explain and reproduce the problem. I tried also with
Konqueror (KHTML)
but -as FF- it does nothing. With nothing to compare, we don't know "what's
right".
BTW, 'zoom' is fairly new, CSS3:
http://www.css3.com/css-zoom/
Original comment by tokland
on 4 Jan 2010 at 7:33
- Changed state: Fixed
from chrome-type-ahead.
Your extension is just **perfect** now!
By the way, you could translate the word "of". In Portuguese (my language), it
means
"de", like "1 de 10" (1 of 10).
Original comment by [email protected]
on 4 Jan 2010 at 11:12
from chrome-type-ahead.
Ignore my last suggestion! I myself translated that word on the js file. I
don´t want
to give you more work than I´ve already given.
Have a nice 2010!
Original comment by [email protected]
on 4 Jan 2010 at 11:15
from chrome-type-ahead.
Related Issues (20)
- Change highlight color HOT 3
- Option for . instead of / (like Opera) HOT 2
- Allow option to only start searching with "/" HOT 1
- Doesn't search inside file:/// directory listings HOT 2
- custom shortcut HOT 1
- tab/ctrl+tab to move to next link/previous link HOT 2
- Allow positioning of the search box HOT 2
- 0.4.1 starts search when in form field HOT 15
- Change text of 'direct search state' to make it clear what this is and what it means HOT 2
- Blacklisting doesn't work HOT 8
- Please reduce access rights to my browsing behavior HOT 2
- Search doesn't trigger when at a file:// URL HOT 1
- 'R' key does not work in type ahead search HOT 1
- interface HOT 1
- no option to change popup text color or apply general styles
- Copying entered HOT 1
- no longer working in latest chrome canary 41.0.2232.0 HOT 2
- Page's shortcut keys are triggered while searching HOT 2
- in Opera: possible to deactivate some keys? HOT 1
- Search ahead is active when it shouldn't be on workflowy.com
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chrome-type-ahead.