#despite all my interest and url changes somehow this has remained
Explore tagged Tumblr posts
alolan-weavile · 2 years ago
Text
I have been using the exact same weavile icon for almost 7 years. I think I can just never change it now
1 note · View note
suzanneshannon · 4 years ago
Text
Here’s How I Solved a Weird Bug Using Tried and True Debugging Strategies
Remember the last time you dealt with a UI-related bug that left you scratching your head for hours? Maybe the issue was happening at random, or occurring under specific circumstances (device, OS, browser, user action), or was just hidden in one of the many front-end technologies that are part of the project?
I was recently reminded of how convoluted UI bugs can be. I recently fixed an interesting bug that was affecting some SVGs in Safari browsers with no obvious pattern or reason. I had searched for any similar issues to get some clue about what was going on, but I found no useful results. Despite the obstacles, I managed to fix it.
I analyzed the problem by using some useful debugging strategies that I’ll also cover in the article. After I submitted the fix, I was reminded of the advice Chris has tweeted out a while back.
Write the article you wish you found when you googled something.
— Chris Coyier (@chriscoyier) October 30, 2017
…and here we are.
Here’s the problem
I found the following bug on a project I’ve been working on. This was on a live site.
I reproduced this issue with any paint event, for example, resizing the screen.
I created a CodePen example to demonstrate the issue so you can check it out for yourself. If we open the example in Safari, the buttons might look as expected on load. But if we click on the first two larger buttons, the issue rears its ugly head. 
Whenever a browser paint event happens, the SVG in the larger buttons render incorrectly. It simply gets cut off. It might happen randomly on load. It might even happen when the screen is resized. Whatever the situation, it happens!
Ugh, why is the SVG icon getting cut off?!
Here’s how I approached the problem.
First off, let’s consider the environment
It’s always a good idea to go over the details of the project to understand the environment and conditions under which the bug is present.
This particular project is using React (but is not required for following this article).
The SVGs are imported as React components and are inlined in HTML by webpack.
The SVGs have been exported from a design tool and have no syntax errors.
The SVGs have some CSS applied to them from a stylesheet.
The affected SVGs are positioned inside a <button> HTML element.
The issue occurs only in Safari (and was noticed on version 13).
Down the rabbit hole
Let’s take a look at the issue and see if we can make some assumptions about what is going on. Bugs like this one get convoluted, and we won’t immediately know what is going on. We don’t have to be 100% correct in our first try because we’ll go step-by-step and form hypotheses that we can test to narrow down the possible causes. 
Forming a hypothesis
At first, this looks like a CSS issue. Some styles might be applied on a hover event that breaks the layout or the overflow property of the SVG graphic. It also looks like the issue is happening at random, whenever Safari renders the page (paint event when resizing the screen, hover, click, etc.).
Let’s start with the simple and most obvious route and assume that CSS is the cause of the issue. We can consider the possibility that there is a bug in the Safari browser that causes SVG to render incorrectly when some specific style applies to the SVG element, like a flex layout, for example.
By doing so, we’ve formed a hypothesis. Our next step is to set up a test that is either going to confirm or contradict the hypothesis. Each test result will produce new facts about the bug and help form further hypotheses. 
Problem simplification
We’ll use a debugging strategy called problem simplification to try and pinpoint the issue. Cornell University’s CS lecture describes this strategy as “an approach to gradually eliminate portions of the code that are not relevant to the bug.”
By assuming the issue lies within CSS, we can end up pinpointing the issue or eliminating the CSS from the equation, reducing the number of possible causes and the complexity of the problem. 
Let’s try and confirm our hypothesis. If we temporarily exclude all non-browser stylesheets, the issue should not occur. I did that in my source code by commenting out the following line of code in my project.
import 'css/app.css';
I have created a handy CodePen example to demonstrate these elements without CSS included. In React, we are importing SVG graphics as components, and they are inlined in HTML using webpack.
CodePen Embed Fallback
If we open this pen on Safari and click on the button, we are still getting the issue. It still happens when the page loads, but on CodePen we have to force it by clicking the button. We can conclude that the CSS isn’t the culprit, but we can also see that only the two out of five buttons break under this condition. Let’s keep this in mind and move on to the next hypothesis.
The same SVG elements still break with excluded stylesheets (Safari 13)
Isolating the issue
Our next hypothesis states that Safari has a bug when rendering SVG inside an HTML <button> element. Since the issue has occurred on the first two buttons, we’ll isolate the first button and see what happens.
Sarah Drasner explains the importance of isolation and I highly recommend reading her article if you want to learn more about debugging tools and other approaches.
Isolation is possibly the strongest core tenets in all of debugging. Our codebases can be sprawling, with different libraries, frameworks, and they can include many contributors, even people who aren’t working on the project anymore. Isolating the problem helps us slowly whittle away non-essential parts of the problem so that we can singularly focus on a solution.
A “reduced test case” it is also often called. 
I moved this button to a separate and empty test route (blank page). I created the following CodePen to demonstrate that state. Even though we’ve concluded that the CSS is not the cause of the issue, we should keep it excluded until we’ve found out the real cause of the bug, to keep the problem simple as possible.
CodePen Embed Fallback
If we open this pen in Safari, we can see that we can no longer reproduce the issue and the SVG graphic displays as expected after clicking the button. We shouldn’t consider this change as an acceptable bug fix, but it gives a good starting point in creating a minimal reproducible example.
A minimal reproducible example
The main difference between the previous two examples is the button combination. After trying out all possible combinations, we can conclude that this issue occurs only when a paint event occurs on a larger SVG graphic that is alongside a smaller SVG graphic on the same page.
We created a minimal reproducible example that allows us to reproduce the bug without any unnecessary elements. With minimal reproducible example, we can study the issue in more detail and accurately pinpoint the part of the code causing it.
I’ve created the following CodePen to demonstrate the minimal reproducible example.
CodePen Embed Fallback
If we open this demo in Safari and click on a button, we can see the issue in action and form a hypothesis that these two SVGs somehow conflict with one another. If we overlay the second SVG graphic over the first, we can see that the size of the cropped circle on the first SVG graphic matches the exact dimensions of the smaller SVG graphic.
Edited image that compares the smaller SVG graphic to the first SVG graphic with the bug present
Divide and conquer
We’ve narrowed down the issue to the combination of two SVG graphics. Now we’re going to narrow things down to the specific SVG code that’s messing things up. If we only have a basic understanding of SVG code and want to pinpoint the issue, we can use a binary tree search strategy with a divide-and-conquer approach. Cornell University’s CS lecture describes this approach:
For example, starting from a large piece of code, place a check halfway through the code. If the error doesn’t show up at that point, it means the bug occurs in the second half; otherwise, it is in the first half. 
In SVG, we can try deleting <filter> (and also <defs> since it’s empty anyway) from the first SVG. Let’s first check what <filter> does. This article by Sara Soueidan explains it best.
Just like linear gradients, masks, patterns, and other graphical effects in SVG, filters have a conveniently-named dedicated element: the <filter> element.
A <filter> element is never rendered directly; its only usage is as something that can be referenced using the filter attribute in SVG, or the url() function in CSS.
In our SVG, <filter> applies a slight inset shadow at the bottom of the SVG graphic. After we delete it from the first SVG graphic, we expect the inner shadow to be gone. If the issue persists, we can conclude that something is wrong with the rest of the SVG markup.
I’ve created the following CodePen to showcase this test.
CodePen Embed Fallback
As we can see, the issue persists anyway. The inset bottom shadow is displayed even though we’ve removed the code. Not only that, now the bug appears on every browser. We can conclude that the issue lies within the rest of the SVG code. If we delete the remaining id from <g filter="url(#filter0_ii)">, the shadow is fully removed. What is going on?
Let’s take another look at the previously mentioned definition of the <filter> property and notice the following detail:
A <filter> element is never rendered directly; its only usage is as something that can be referenced using the filter attribute in SVG.
(Emphasis mine)
So we can conclude that the filter definition from the second SVG graphic is being applied to the first SVG graphic and causing the error.
Fixing the issue
We now know that issue is related to the <filter> property. We also know that both SVGs have the filter property since they use it for the inset shadow on the circle shape. Let’s compare the code between the two SVGs and see if we can explain and fix the issue.
I’ve simplified the code for both SVG graphics so we can clearly see what is going on. The following snippet shows the code for the first SVG.
<svg width="46" height="46" viewBox="0 0 46 46"> <g filter="url(#filter0_ii)"> <!-- ... --> </g> <!-- ... --> <defs> <filter id="filter0_ii" x="0" y="0" width="46" height="46"> <!-- ... --> </filter> </defs> </svg>
And the following snippet shows the code for the second SVG graphic.
<svg width="28" height="28" viewBox="0 0 28 28"> <g filter="url(#filter0_ii)"> <!-- ... --> </g> <!-- ... --> <defs> <filter id="filter0_ii" x="0" y="0" width="28" height="28"> <!-- ... --> </filter> </defs> </svg>
We can notice that the generated SVGs use the same id property id=filter0_ii. Safari applied the filter definition it read last (which, in our case, is the second SVG markup) and caused the first SVG to become cropped to the size of the second filter (from 46px to 28px). The id property should have a unique value in DOM. By having two or more id properties on a page, browsers cannot understand which reference to apply, and the filter property redefines on each paint event, dependent on the racing condition that causes the issue to appear randomly.
Let’s try assigning unique id attribute values to each SVG graphic and see if that fixes the issue.
CodePen Embed Fallback
If we open the CodePen example in Safari and click the button, we can see that we fixed the issue by assigning a unique ID to <filter> property in each SVG graphic file. If we think about the fact that we have non-unique value for an attribute like id, it means that this issue should be present on all browsers. For some reason, other browsers (including Chrome and Firefox) seem to handle this edge-case without any bugs, although this might be just a coincidence.
Wrapping up
That was quite a ride! We started barely knowing anything about an issue that seemingly occurred at random, to fully understanding and fixing it. Debugging UI and understanding visual bugs can be difficult if the cause of the issue is unclear or convoluted. Luckily, some useful debugging strategies can help us out.
First, we simplified the problem by forming hypotheses which helped us eliminate the components that were unrelated to the issue (style, markup, dynamic events, etc.). After that, we isolated the markup and found the minimal reproducible example which allowed us to focus on a single chunk of code. Finally, we pinpointed the issue with a divide-and-conquer strategy, and fixed it.
Thank you for taking the time to read this article. Before I go, I’d like to leave you with one final debugging strategy that is also featured in Cornell University’s CS lecture. 
Remember to take a break, relax and clear your mind between debugging attempts.
 If too much time is spent on a bug, the programmer becomes tired and debugging may become counterproductive. Take a break, clear your mind; after some rest, try to think about the problem from a different perspective.
References
Cornell University CS 312 Lecture 26 – Debugging Techniques
Debugging Tips and Tricks
Reduced Test Cases
SVG Filters 101
The post Here’s How I Solved a Weird Bug Using Tried and True Debugging Strategies appeared first on CSS-Tricks.
You can support CSS-Tricks by being an MVP Supporter.
Here’s How I Solved a Weird Bug Using Tried and True Debugging Strategies published first on https://deskbysnafu.tumblr.com/
0 notes
origin-of-drones · 8 years ago
Text
WP ProfitBuilder News Reports
Look Engine Optimization (Search Engine Optimization). SEO is one of the most crucial ability an internet marketing professional should gain from go to toe as it provides marketing experts the capacity to obtain website traffic free of charge and also in addition to the internet search engine. It is the procedure of getting the internet site noted well in search engines that involves several aspects such as the design and web content of the site and also link popularity. Search Engine Optimization is one associate advertising and marketing training for newbies that needs focusing on as the opportunities of people finding your website depends on this. On your landing page generator, do some A/B testing. This is checking to earn certain that your mobile advertising efforts are working for your consumers. This is equally as vital as it is testing web sites. Produce 2 various landing pages (A&B) to see which is much more efficient for conversions. Of both, opt for the web page that carries out the most effective. 3: KNOW YOUR COMPETITORS. Are there similar business supplying comparable product and services? If so, exactly what are their prices, payment plans, costs, etc etc. If you are considering beginning an online travel company, compare numerous of them as well as see which one fits your demands the most effective. What components compose a successful product launch? How a lot would certainly it be worth to you to comply with a launch formula that has been used for a few of the greatest internet product launches in recent background? Think about just how many hrs this would certainly maximize to be made use of for the innovative procedure? There is no need to re-invent the wheel. Kajabi provides you the power to blend it with the large boys (and also women) of the web marketing globe. It levels the playing field. It will change the means individuals produce, launch as well as handle their on the internet products.
Not known Factual Statements About ProfitBuilder
g. upkeep mode plugin). I did have a look for the plugin Variation of Launch effects, I found an announcement from 2012 regarding how the plugin was coming, but didn't see something shortly after that. I’ll be making use of this to select my e mail sorts for my new blog (Each time I finally get all-around to ending it up). This is the default post I’m gonna go back to as I start out working on my blog driving-the-scenes, Adam! Other capabilities like Leadboxes, Leaddigits and Leadlinks don’t have to have everything being put in on your internet site – they’ll get the job done anywhere you prefer. Now, the situation with most plugins of this kind is you get an incredible array of templates. however , you shortly recognize that they aren’t consistent. by way of example, you could potentially produce a guest write-up for an additional Web-site, and involve the code for your Leadbox inside the HTML (furnishing the weblog operator approves) and produce subscribers immediate from a visitor submit. I only use LeadPages and am contemplating also working with OptimizePress two.0. I attempted the initial Model of OptimizePress when I was wp profit builder a fresh blogger and it was much too tough for me to do myself. It’s fantastic to hear which the new edition is so much simpler to employ. With this video, I put in some templates, create a page, and have a Enjoy with the various alternatives available in Profit Builder. (I know how to Examine the speed of the current Internet site, but marvel whether or not the pace of themes could be checked, right before They're made use of.) I haven’t checked it out wp profit builder myself, I agree along with you. The gross sales website page does glance extremely spectacular. need to have to examine this out, really eager to find out how this compares Using the likes of prosper, OP and LP. An additional issue value noting is always that while the WordPress plugin is usually put in on your website, it functions extra like a url out of your web page to Leadpages. So Despite the fact that you’ll have landing web pages load from URL’s on your website, they’ll however be loading from Leadpages servers. I have worked with OP2 and it is without a doubt fantastic, but you regularly mentions by video clips it is a bit more rapidly and much better working experience in in the day-to-day use – Believe you will be right there, even without having I even tried this one. thinking about you wp profit builder only have to pay a 1 time payment for the plugin, as opposed to related plugins, I would propose WP Profit Builder in a very heartbeat. In fact, the first thing I constructed with this particular plugin had been the wp profit builder profits pages for the advertising agency I employed to operate for. they usually seemed wonderful. New drag & drop site builder with some new templates that weren’t offered with their standard webpage builder. And at last, the developer license. I had been thinking Should you have made use of it personally together with your clientele And the way they favored the shopper aspect of the solution.
Rumored Buzz on ProfitBuilder 2.0
Making a mobile website needs to be brain-dead easy nowadays for there currently exist systems that actually allow you to construct your own mobile pages also when you do not actually understand anything concerning XHTML. These are systems that allow you work on mobile web page development procedures in a WYSWYG (exactly what you see is exactly what you obtain) basis. Nevertheless, absolutely nothing can be truly simpler compared to directing and also clicking, dragging and also dropping and also reducing and pasting when tailoring web pages that you believe will certainly interest your type of audience. Your sign-up form is actually important to think about when creating a mobile website. If it's also complex or has way too many areas for them to complete, they will not do it. See to it that just like the remainder of the web page, the sign-up type is easy as well as very easy. It ought to have as few needed Profit Builder 2 fields as possible. If you require more information, obtain them to authorize up very first and have them enter it later on. Ordinary check out period - the typical time of individuals' brows through. As a policy of thumb the more time site visitor invest the higher conversion rate and the much more sales revenue you will probably obtain. It did not take as well long prior to a special area was produced! It has actually now been 3 years given that Wealthy Associate was produced. The 3.0 variation came out in january and also they somehow handled making it less complicated as well as faster to utilize the tools available. When I signed up with, I intended to remain unbiased completely through my understanding procedure. After just a couple of days, I was already addicted to what they were offering! There was information about nearly every means to earn loan online. Everything is quite possibly described. There is web content equivalent to shut to fifty publications therein. Developing a checklist is one point. Keep it active, as well as responsive is something else. Certain, it's rather straightforward to obtain some sort of leadpages and also build a capture web page. You can also buy or employ someone to write you a decent, thirty page digital book that you can use for an email. Learn just what you could from other marketing experts about their experiences with programs and determine which devices will aid your campaign leverage itself for ideal results.
0 notes