whoami

Lucas Jenß

cat /etc/motd

The Coding Journal ツ — Notes taken on an epic coding journey. Technical solutions, debugging notes, and practical guides from the trenches of software development.

Close-up of white dominoes with black dots standing on green felt surface, shallow depth of field, focused mood

ls -la ~/languages/

total 8
drwxr-xr-x
▶ PHP
▶ Ruby
▶ Scala
▶ C#
▶ JavaScript
▶ Objective-C
▶ Shell Scripting

ls -la ~/toolchain/

total 7
drwxr-xr-x
▶ Typo3
▶ Akka
▶ Capistrano
▶ Git
▶ MAMP
▶ Adobe Illustrator
▶ NSTrackingArea (Cocoa)

uname -a

platforms
drwxr-xr-x
▶ Mac OS X
▶ Unix

Firefox SVG rendering bugs with Illustrator paths

Debugging SVG rendering bugs in Firefox when using Illustrator-generated paths becomes manageable when the export is treated as structured XML rather than a finished picture. Illustrator can leave nested groups, generated identifiers, styles, masks, and transformed coordinates that look valid in the design application but behave differently after web embedding.

The usual symptoms are a missing glyph, an unexpected fill, clipped artwork, shifted outlines, or a path that appears in Chrome but not Firefox. The important distinction is whether the file is loaded through an image element, embedded inline, or injected by JavaScript; each route gives the browser a different cascade and referencing context.

A reliable fix starts with a reduced file, a recorded browser state, and a source export rather than random edits to the live page. Adobe Illustrator remains familiar in Australian studios, while Sydney and Melbourne teams often hand assets to distributed developers in Brisbane or Perth without sharing the original design document.

Reproduce the failure with a controlled SVG

Save the failing artwork as a standalone .svg, then open it directly in Firefox. If it renders there, the fault probably belongs to the host page’s CSS, SVG injection, or dimensions. If it still fails, the exported file has become the primary suspect.

Open Firefox Developer Tools and inspect the console for XML parser errors, unresolved references, or blocked resources. In the Inspector, select the affected path and review its computed fill, stroke, opacity, clip-path, and transform values. Disable rules individually rather than changing several properties together.

Remove artwork until the defect remains in a minimal SVG containing one root, one group, and one path. Keep that reduced case as a separate file and compare it with the original using DOM snapshots. Wider engineering notes from CCJ Engineering can complement this kind of project-level diagnosis.

Dissect the Illustrator export

Illustrator’s SVG writer often preserves its layer model. A single visible logo may therefore expand into nested groups, private <defs>, clip paths, masks, and presentation attributes. Read the source in an XML-aware editor, and expand collapsed nodes in Firefox so the visual hierarchy matches the markup.

Pay particular attention to identifiers. Duplicated id values from copied layers or merged files can make url(#clip-1) resolve to the wrong object, while renamed or case-changed IDs can leave a reference dangling. Search every id, href, and xlink:href, then confirm that each target is unique and exactly matched.

Next, compare the root viewBox with its width, height, and preserveAspectRatio. Conflicting units or percentage dimensions can create a tiny viewport, especially inside a responsive container. For complex artwork, use the Inspector console to compare getCTM() and getScreenCTM() before flattening any transforms.

Check path syntax, fills and strokes

Path data is compact but unforgiving. A missing command argument, malformed arc flag, invalid number, or incorrect exponent can prevent the d attribute from drawing. Copy the attribute into a reduced case, validate the XML, and inspect the path’s d value for NaN values, stray commas, and incomplete commands.

Filled shapes also depend on winding direction and fill rules. Illustrator may export self-intersecting contours with fill-rule="evenodd" or nonzero", then apply a matching clip-rule to a clip path. If Firefox shows a hole in the wrong place, compare those properties and temporarily set the intended rule directly on the element.

For outlines, check stroke-width, stroke-linecap, stroke-linejoin, and stroke-miterlimit; scaling through a transform can also change the perceived weight. The Inspector’s SVG pane shows the geometry box, but getBBox() and getTotalLength() can help detect zero-sized or unexpectedly short paths before changing any coordinates.

Separate style and compositing failures

An inline SVG inherits the surrounding document’s styles. A broad selector such as path { fill: currentColor; } can override Illustrator’s presentation attributes because CSS has higher priority. Use the Styles panel to see which rule wins, then scope the artwork’s classes or move the asset into an <img> element.

Clipping and masking failures often appear as partial or missing artwork. Toggle clip-path, mask, filters, group opacity, and blend modes independently in Firefox. Remember that a mask may use alpha or luminance while a clip path uses geometry; changing one type for another can alter the result.

Illustrator can also emit legacy compositing properties such as enable-background, or place opacity on nested groups. Replace those effects with an explicit background shape and a single opacity value where practical. This removes browser-sensitive rendering stages without redesigning the artwork.

Firefox symptom Likely source Quick check Correction
Whole icon absent Invalid XML or duplicate id Console and identifier search Repair the markup and make IDs unique
Fill or colour differs Host CSS overriding presentation attributes Computed styles Scope selectors or use an external SVG
Artwork cut off Clip path, mask, or root overflow Toggle compositing properties Rebuild the clip with explicit coordinates
Outline shifts Nested group transforms Compare getCTM() values Flatten the transform hierarchy
Shape changes on resize viewBox and dimensions disagree Inspect root SVG attributes Set one responsive coordinate system

Create a predictable Illustrator export

Build a dedicated web export rather than reusing the print profile. In Illustrator, review the SVG profile, decimal precision, font handling, and responsive options. Use consistent IDs, avoid unnecessary clipping and masks, and convert final text to outlines when the visual result must be identical everywhere.

Decide where effects belong. Flattening a simple appearance merge is often safer than shipping an Illustrator-only filter, but converting every object can destroy reusable structure and bloat the file. Keep a pristine design file, export a web-specific derivative, and diff both outputs whenever Illustrator or an extension is updated.

Some defects also need a controlled post-processing step rather than manual repair. The same principle appears in custom TYPO3 XCLASS patching: a bespoke override is added without rewriting the whole extension. For SVG assets, a small, versioned script can similarly normalise IDs, remove legacy properties, and leave the source export untouched.

Test the repaired asset in real conditions

Check the result in current Firefox, Chromium, and Safari, then repeat at the browser sizes and pixel densities used by the audience. Test both standalone and embedded files because a corrected path can still be clipped by its host container. If a valid reduced asset fails only in Firefox, compare a fresh profile and inspect the graphics information under about:support.

Include low-bandwidth and high-density cases. Australian retail, tourism, and transport clients often publish artwork for regional mobile users as well as metro storefronts, so a file that looks correct on a developer’s fast connection may still fail because of excessive filters or embedded data.

Accessibility checks belong in the same pass. Public-sector services publishing under the Australian Government Digital Service Standard need meaningful alternative text, and decorative vectors should be hidden from assistive technology. An Illustrator path has no native semantics, so add an accessible name or treat the SVG as decorative at the embedding layer.

Make the repair repeatable

Turn the proven correction into a repeatable build step. Store the minimal failing asset, the normalised export, and a short note explaining which layer caused the defect. Run XML validation, compare identifiers, and render screenshots before the file reaches production.

  • Keep the original Illustrator document beside every web export.
  • Validate XML and scan for duplicate identifiers in continuous integration.
  • Scope inline SVG styles so page CSS cannot alter artwork.
  • Standardise the viewBox, dimensions, and transform hierarchy.
  • Test Firefox alongside Chromium and Safari at supported breakpoints.
  • Save reduced examples as regression fixtures for future upgrades.

Start by opening the current failing export in Firefox, reduce it to the smallest failing case, and apply the first correction supported by the evidence. Publish the repaired asset through the normal deployment pipeline, then retain that reduced case as a permanent regression check.


cat ~/interests.json

KeyValue
editorTerminal-first workflow
osMac OS X / Unix
vcsGit, distributed version control
deployCapistrano, cron automation
graphicsSVG, Adobe Illustrator troubleshooting
networkingIP validation, SSH, VPN

git log --oneline --reverse

2013-10-30

Solving SVG import issues in Adobe Illustrator CS6 and CC

When importing an SVG into Illustrator, the operation fails with an unknown error [CANT]. A workaround for this Adobe-side bug.

2013

Solving NDK build issues on OS X

Troubleshooting native development kit compilation problems on Mac OS X.

2013

Programmatically adding PHP generated TypoScript to the backend configuration

Integrating dynamically generated TypoScript into Typo3 backend setups using PHP.

2013

ArgumentError: Could not parse PKey: no start line

Debugging an SSH key parsing error encountered during deployment.

2011-08-04

Validating IP-Addresses in PHP

Using PHP filter functions with flags like FILTER_FLAG_IPV4 and FILTER_FLAG_IPV6, and understanding how filter_var handles reserved IP addresses.

2011-07-09

Cocoa: Using NSTrackingArea

A short tutorial on using Cocoa's NSTrackingArea to capture mouseEntered and mouseExited events.


cat ~/contact.txt

github: github.com/x3ro
stackoverflow: x3ro
coderwall: coderwall.com/x3ro
twitter: @x3rames